diff --git a/exec_apply_effects.lua b/exec_apply_effects.lua index fc94c13..c90755e 100644 --- a/exec_apply_effects.lua +++ b/exec_apply_effects.lua @@ -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) diff --git a/fs/fs_talkdialog.lua b/fs/fs_talkdialog.lua index 7a30ee3..9fc03ec 100644 --- a/fs/fs_talkdialog.lua +++ b/fs/fs_talkdialog.lua @@ -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 diff --git a/quest_api.lua b/quest_api.lua index f2a86dd..96f77d9 100644 --- a/quest_api.lua +++ b/quest_api.lua @@ -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