Skip to content

Commit

Permalink
Avoid errors if scenario is played with one of the sides empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ln-zookeeper committed May 8, 2016
1 parent e4450de commit dee6fbf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions data/multiplayer/scenarios/2p_Hornshark_Island_lua
Expand Up @@ -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
Expand Down

0 comments on commit dee6fbf

Please sign in to comment.