Avoid errors if scenario is played with one of the sides empty
This commit is contained in:
parent
cb71b330e9
commit
96bd5ae982
1 changed files with 7 additions and 2 deletions
|
@ -20,8 +20,13 @@
|
|||
end
|
||||
local function leader_matches()
|
||||
local actual = wesnoth.get_units({ canrecruit = true, side = side_number })[1]
|
||||
for searched in string.gmatch(multiplayer_side.leader, "[^%s,][^,]*") do
|
||||
if searched == actual.type then return true end
|
||||
|
||||
if actual then
|
||||
for searched in string.gmatch(multiplayer_side.leader, "[^%s,][^,]*") do
|
||||
if searched == actual.type then return true end
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
if recruits_match() and leader_matches() then
|
||||
|
|
Loading…
Add table
Reference in a new issue