Tutorial S01: Synchronise the choice of character

This avoids showing the dialog during replays, and thus avoids an
OOS if the person watching the replay chooses the other character.
This commit is contained in:
Steve Cotton 2021-07-28 10:52:15 +02:00 committed by Steve Cotton
parent 57ce449af8
commit 3d50320369

View file

@ -11,7 +11,10 @@ function wml_actions.select_character()
local character_selection_dialog = wml.load "campaigns/tutorial/gui/character_selection.cfg"
local dialog_wml = wml.get_child(character_selection_dialog, 'resolution')
local character = gui.show_dialog(dialog_wml)
local result = wesnoth.sync.evaluate_single(function()
return { value = gui.show_dialog(dialog_wml) }
end)
local character = result.value
local unit = wml.variables.student_store
if character == 2 then