ask for save/discard/back only when actually switching to a diffrent dialog

This commit is contained in:
Sokomine 2021-05-06 19:22:17 +02:00
parent ca438dd71b
commit f1bd0cb8a0

View File

@ -2588,8 +2588,14 @@ minetest.register_on_player_receive_fields(
end
end
-- if there are any changes done: ask first and don't switch to the new dialog yet
yl_speak_up.save_changes_and_switch_to_other_dialog(player, fields, show_dialog)
return
if(show_dialog ~= d_id) then
yl_speak_up.save_changes_and_switch_to_other_dialog(player, fields, show_dialog)
-- show the same dialog again
else
minetest.show_formspec(pname, "yl_speak_up:talk", get_fs_talkdialog(player, n_id, d_id))
end
-- no option was selected - so we need to end this here
return
end