fix [message] side_for= not working for the last side.

fixes #2776

(cherry-picked from commit 0f756b8189)
This commit is contained in:
gfgtdf 2018-04-04 18:21:56 +02:00 committed by Charles Dang
parent 687d81850a
commit 59cc2448dc

View file

@ -379,7 +379,7 @@ function wesnoth.wml_actions.message(cfg)
-- Sanity checks on side number and controller
for side in utils.split(sides_for) do
side = tonumber(side)
if side > 0 and side < #wesnoth.sides
if side > 0 and side <= #wesnoth.sides
and wesnoth.sides[side].controller == "human"
and wesnoth.sides[side].is_local
then