Skip to content

Commit

Permalink
Fixup [unstore_unit] Lua port
Browse files Browse the repository at this point in the history
Restores check_passability default of yes.
Fixes 50a9a25
  • Loading branch information
sigurdfdragon committed Mar 15, 2017
1 parent 6c994a5 commit 9423e47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion data/lua/wml-tags.lua
Expand Up @@ -1206,12 +1206,13 @@ wml_actions.unstore_unit = function(cfg)
local unit = wesnoth.create_unit(unit_cfg)
local advance = cfg.advance ~= false
local animate = cfg.animate ~= false
local check_passability = cfg.check_passability ~= false or nil
local x = cfg.x or unit.x or -1
local y = cfg.y or unit.y or -1
wesnoth.add_known_unit(unit.type)
if on_board(x, y) then
if cfg.find_vacant then
x,y = wesnoth.find_vacant_tile(x, y, cfg.check_passability and unit)
x,y = wesnoth.find_vacant_tile(x, y, check_passability and unit)
end
unit:to_map(x, y, cfg.fire_event)
local text = nil
Expand Down

0 comments on commit 9423e47

Please sign in to comment.