Skip to content

Commit

Permalink
Simplify a few wesnoth.*_unit calls
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Vultraz committed Oct 15, 2019
1 parent d757255 commit 0d60a88
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions data/lua/wml-tags.lua
Expand Up @@ -408,7 +408,7 @@ function wml_actions.store_unit(cfg)

for i,u in ipairs(units) do
utils.vwriter.write(writer, u.__cfg)
if kill_units then wesnoth.erase_unit(u) end
if kill_units then u:erase() end
end

if (not filter.x or filter.x == "recall") and (not filter.y or filter.y == "recall") then
Expand All @@ -417,7 +417,7 @@ function wml_actions.store_unit(cfg)
ucfg.x = "recall"
ucfg.y = "recall"
utils.vwriter.write(writer, ucfg)
if kill_units then wesnoth.erase_unit(u) end
if kill_units then u:erase() end
end
end
end
Expand Down Expand Up @@ -549,8 +549,8 @@ function wml_actions.petrify(cfg)
for index, unit in ipairs(wesnoth.get_units(cfg)) do
unit.status.petrified = true
-- Extract unit and put it back to update animation (not needed for recall units)
wesnoth.extract_unit(unit)
wesnoth.put_unit(unit)
unit:extract()
unit:to_map()
end

for index, unit in ipairs(wesnoth.get_recall_units(cfg)) do
Expand All @@ -562,8 +562,8 @@ function wml_actions.unpetrify(cfg)
for index, unit in ipairs(wesnoth.get_units(cfg)) do
unit.status.petrified = false
-- Extract unit and put it back to update animation (not needed for recall units)
wesnoth.extract_unit(unit)
wesnoth.put_unit(unit)
unit:extract()
unit:to_map()
end

for index, unit in ipairs(wesnoth.get_recall_units(cfg)) do
Expand Down

0 comments on commit 0d60a88

Please sign in to comment.