From 04b67da67099f15fb55790055a5fae9b09b77577 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Fri, 9 Feb 2024 06:22:53 +0100 Subject: [PATCH] added exception for npc_was_changed in functions.lua --- functions.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/functions.lua b/functions.lua index a433454..73b35fc 100644 --- a/functions.lua +++ b/functions.lua @@ -2,10 +2,6 @@ -- Init --### --- changes applied in edit_mode are applied immediately - but not immediately stored to disk --- (this gives the players a chance to back off in case of unwanted changes) --- TODO yl_speak_up.npc_was_changed = {} - -- self (the npc as such) is rarely passed on to any functions; in order to be able to check if -- the player really owns the npc, we need to have that data available; -- format: yl_speak_up.npc_owner[ npc_id ] = owner_name @@ -274,7 +270,9 @@ yl_speak_up.add_new_option = function(dialog, pname, next_id, d_id, option_text, dialog.n_dialogs[d_id].d_options[future_o_id].o_sort = s -- log only in edit mode local n_id = yl_speak_up.speak_to[pname].n_id - if(yl_speak_up.npc_was_changed[ n_id ]) then + -- would be too difficult to add an exception for edit_mode here; thus, we do it directly here: + if(yl_speak_up.npc_was_changed + and yl_speak_up.npc_was_changed[n_id]) then table.insert(yl_speak_up.npc_was_changed[ n_id ], "Dialog "..d_id..": Added new option/answer "..future_o_id..".") end