From 5efdd9fd79c9987d84a39932cce8b884d1ee8002 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Mon, 21 Jun 2021 19:45:47 +0200 Subject: [PATCH] if an action fails and has no existing on_failure dialog, go back to the current dialog --- fs_edit_actions.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs_edit_actions.lua b/fs_edit_actions.lua index 62fae13..7813b1d 100644 --- a/fs_edit_actions.lua +++ b/fs_edit_actions.lua @@ -155,6 +155,10 @@ yl_speak_up.execute_next_action = function(player, a_id, result_of_a_id) local this_action = actions[ sorted_key_list[ nr ]] -- if there is an on_failure target dialog: go there if(this_action.a_on_failure) then + -- go back to the same dialog + if(not(dialog.n_dialogs[this_action.a_on_failure])) then + this_action.a_on_failure = d_id + end -- set the current action to nil yl_speak_up.speak_to[pname].a_id = nil -- no option of the new dialog has been selected yet