Update code of [unstore_unit]

This commit is contained in:
Hejnewar 2021-04-22 01:32:06 +02:00 committed by GitHub
parent 73a76a1644
commit f5ea3b0906
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -790,7 +790,7 @@ 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 = table.unpack(wesnoth.special_locations[cfg.location_id])
x,y = table.unpack(wesnoth.current.map.special_locations[cfg.location_id])
end
wesnoth.add_known_unit(unit.type)
if x ~= 'recall' and y ~= 'recall' and wesnoth.current.map:on_board(x, y) then
@ -829,7 +829,7 @@ wml_actions.teleport = function(cfg)
end
local x,y = cfg.x, cfg.y
if cfg.location_id then
x,y = table.unpack(wesnoth.special_locations[cfg.location_id])
x,y = table.unpack(wesnoth.current.map.special_locations[cfg.location_id])
end
wesnoth.teleport(unit, x, y, cfg.check_passability == false, cfg.clear_shroud ~= false, cfg.animate)
end