Avoid errors if scenario is played with one of the sides empty
This commit is contained in:
parent
e4450dec82
commit
dee6fbf24f
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