fixed undeclared globals
This commit is contained in:
parent
94906c221b
commit
cce17c7c23
@ -467,9 +467,9 @@ yl_speak_up.execute_effect = function(player, n_id, o_id, r)
|
||||
return false
|
||||
elseif(amount < stack_got:get_count()) then
|
||||
local rest = stack_got:get_count() - amount
|
||||
player_inv = player:get_inventory()
|
||||
local player_inv = player:get_inventory()
|
||||
if(player_inv) then
|
||||
rest_stack = ItemStack(stack_got:to_table())
|
||||
local rest_stack = ItemStack(stack_got:to_table())
|
||||
rest_stack:set_count(rest)
|
||||
player_inv:add_item("main", rest_stack)
|
||||
stack_got:set_count(amount)
|
||||
|
@ -374,7 +374,8 @@ yl_speak_up.apply_autoanswer_and_random_and_d_got_item = function(player, pname,
|
||||
-- show the new target dialog and exit
|
||||
-- the recursion_depth will be increased by one (we did autoselect here and need to
|
||||
-- avoid infinite loops)
|
||||
return yl_speak_up.get_fs_talkdialog(player, n_id, target_dialog, res.alternate_text,
|
||||
return yl_speak_up.get_fs_talkdialog(player,
|
||||
yl_speak_up.speak_to[pname].n_id, target_dialog, res.alternate_text,
|
||||
recursion_depth + 1)
|
||||
end
|
||||
|
||||
|
@ -215,6 +215,7 @@ yl_speak_up.get_quest_variable_value = function(player_name, variable_name)
|
||||
-- the owner name is alrady encoded in the variable name
|
||||
local k = tostring(variable_name)
|
||||
if(not(variable_name) or not(player_name) or not(yl_speak_up.player_vars[ k ])) then
|
||||
local k_long = yl_speak_up.add_pname_to_var(k, player_name or "")
|
||||
yl_speak_up.get_variable_metadata(k_long, "default_value", true)
|
||||
return nil
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user