Simplify a few wesnoth.*_unit calls

[ci skip]
This commit is contained in:
Charles Dang 2019-10-15 20:21:22 +11:00
parent d757255216
commit 0d60a884c3

View file

@ -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
@ -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
@ -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
@ -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