From 216c77ca8171d82b2dc5fd4424402c400feaadf5 Mon Sep 17 00:00:00 2001 From: zorman2000 Date: Sun, 4 Dec 2016 10:01:37 -0500 Subject: [PATCH] Dialogues: fixed bug with options dialogue --- dialogue.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dialogue.lua b/dialogue.lua index 6e03352..9acbce4 100644 --- a/dialogue.lua +++ b/dialogue.lua @@ -110,6 +110,8 @@ end -- and process it. function npc.dialogue.start_dialogue(self, player) -- Choose a dialogue randomly + -- TODO: Add support for favorite items hints + -- Add support for flags local dialogue = self.dialogues[math.random(1, #self.dialogues)] npc.dialogue.process_dialogue(self, dialogue, player:get_player_name()) end @@ -131,8 +133,6 @@ function npc.dialogue.process_dialogue(self, dialogue, player_name) player_name ) end - -- TODO: Add support for flag, multi-option dialogue - -- and their actions end ----------------------------------------------------------------------------- @@ -205,7 +205,10 @@ minetest.register_on_player_receive_fields(function (player, formname, fields) if fields[button_label] then if player_response.options[i].action_type == "dialogue" then -- Process dialogue object - npc.dialogue.process_dialogue(player_response.options[i].action, player_name) + minetest.log("Action: "..dump(player_response.options[i])) + npc.dialogue.process_dialogue(player_response.npc, + player_response.options[i].action, + player_name) elseif player_response.options[i].action_type == "function" then -- Execute function - get it directly from definition -- Find NPC relationship phase with player