[world conquest] [master] [lua] Check for wc2_scenario value before executing wc2_start_units function (#6052)

What this does is just checks the value of wc2_scenario before executing the function, and executes it for the first scenario only as intended.
This commit is contained in:
Tahsin Jahin Khalid 2021-08-31 21:36:19 +06:00 committed by GitHub
parent 47bff304fc
commit 19b38fe249
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,10 +65,12 @@ end)
-- we need to do this also after difficulty selection.
-- NOTE: this is a bit fragile, in particualr it breaks if difficulty_selection happens before the prestart event above.
on_event("wc2_start", function(cx)
for side_num = 1, wml.variables.wc2_player_count do
wesnoth.wml_actions.wc2_start_units {
side = side_num
}
if wml.variables.wc2_scenario == 1 then
for side_num = 1, wml.variables.wc2_player_count do
wesnoth.wml_actions.wc2_start_units {
side = side_num
}
end
end
if wml.variables.wc2_difficulty.extra_training then