attempt to fix bug in [message]

previously this bug http://i.imgur.com/9B7bquA.png happend in LoW scenario3.
This commit is contained in:
gfgtdf 2015-11-27 18:13:07 +01:00
parent be68ebc0a7
commit 59233ce903

View file

@ -42,9 +42,9 @@ local function get_speaker(cfg)
if cfg.speaker == "narrator" then
speaker = "narrator"
elseif cfg.speaker == "unit" then
speaker = wesnoth.get_unit(context.x1, context.y1)
speaker = wesnoth.get_unit(context.x1 or 0, context.y1 or 0)
elseif cfg.speaker == "second_unit" then
speaker = wesnoth.get_unit(context.x2, context.y2)
speaker = wesnoth.get_unit(context.x2 or 0, context.y2 or 0)
else
speaker = wesnoth.get_units(cfg)[1]
end