Skip to content

Commit

Permalink
Merge pull request #5521 from MrTitainin/patch-1
Browse files Browse the repository at this point in the history
Fixed unstore_unit lua code (issue #5519)
  • Loading branch information
Vultraz committed Feb 13, 2021
2 parents 04a3b2d + 8db66e8 commit 6bb8544
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions data/lua/wml-tags.lua
Expand Up @@ -839,7 +839,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 = wesnoth.special_locations[cfg.location_id]
x,y = table.unpack(wesnoth.special_locations[cfg.location_id])
end
wesnoth.add_known_unit(unit.type)
if on_board(x, y) then
Expand Down Expand Up @@ -877,10 +877,10 @@ wml_actions.teleport = function(cfg)
return
end
local x,y = cfg.x, cfg.y
if not x or not y then
x,y = wesnoth.special_locations[cfg.location_id]
if cfg.location_id then
x,y = table.unpack(wesnoth.special_locations[cfg.location_id])
end
wesnoth.teleport(unit, cfg.x, cfg.y, cfg.check_passability == false, cfg.clear_shroud ~= false, cfg.animate)
wesnoth.teleport(unit, x, y, cfg.check_passability == false, cfg.clear_shroud ~= false, cfg.animate)
end

function wml_actions.remove_sound_source(cfg)
Expand Down

0 comments on commit 6bb8544

Please sign in to comment.