Fixed unstore_unit lua code (issue #5519)

x,y were both binding to whole table instead of their expected values
This commit is contained in:
MrTitainin 2021-02-06 16:10:59 +01:00 committed by GitHub
parent fb07c247e8
commit add999b9d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -839,7 +839,8 @@ wml_actions.unstore_unit = function(cfg)
local x = cfg.x or unit.x or -1
local y = cfg.y or unit.y or -1
if cfg.location_id then
x, y = wesnoth.special_locations[cfg.location_id]
local loc = wesnoth.special_locations[cfg.location_id]
x,y = loc[1], loc[2]
end
wesnoth.add_known_unit(unit.type)
if on_board(x, y) then