From 0d60a884c349c19e55b1c36abe1c28393339da6d Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Tue, 15 Oct 2019 20:21:22 +1100 Subject: [PATCH] Simplify a few wesnoth.*_unit calls [ci skip] --- data/lua/wml-tags.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/data/lua/wml-tags.lua b/data/lua/wml-tags.lua index 34326e83a66..09d49e1d68c 100644 --- a/data/lua/wml-tags.lua +++ b/data/lua/wml-tags.lua @@ -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