diff --git a/functions.lua b/functions.lua index 0900b2a..8ad2629 100644 --- a/functions.lua +++ b/functions.lua @@ -1908,6 +1908,12 @@ yl_speak_up.save_changes_and_switch_to_other_dialog = function(player, fields, t yl_speak_up.speak_to[pname].dialog = load_dialog(n_id) -- clear list of changes yl_speak_up.npc_was_changed[ n_id ] = {} + -- it is possible that the target dialog was newly added - and just discarded; + -- in such a case stick to the old dialog + local dialog = yl_speak_up.speak_to[pname].dialog + if(not(dialog[target_dialog])) then + target_dialog = yl_speak_up.speak_to[pname].d_id + end end -- are there any changes which might be saved or discarded?