Update of bug #19203 (project wesnoth):

                Severity:              3 - Normal => 4 - Important          
             Assigned to:                    None => anonymissimus          

    _______________________________________________________

Follow-up Comment #2:

Could you post your concrete usecase (some wml code) which works in 1.8 but
not in 1.9 ?

You were using something from a stored unit variables array within the filter
of another [store_unit] tag while neither appending to nor replacing the same
array ? The only way I can think to do that is lua_function, since variable
evaluation isn't valid in filters otherwise.
If so, wouldn't this uninvasive patch fix it (untested):
diff --git a/data/lua/wml-tags.lua b/data/lua/wml-tags.lua
index 5b384fe..9b04e6c 100644
--- a/data/lua/wml-tags.lua
+++ b/data/lua/wml-tags.lua
@@ -409,20 +409,22 @@ function wml_actions.store_unit(cfg)
 
        local var = cfg.variable or "unit"
        local idx = 0
+       local units = wesnoth.get_units(filter)
+       local recall_units = wesnoth.get_recall_units(filter)
        if mode == "append" then
                idx = wesnoth.get_variable(var .. ".length")
        elseif mode ~= "replace" then
                wesnoth.set_variable(var)
        end
 
-       for i,u in ipairs(wesnoth.get_units(filter)) do
+       for i,u in ipairs(units) do
                wesnoth.set_variable(string.format("%s[%d]", var, idx), u.__cfg)
                idx = idx + 1
                if kill_units then wesnoth.put_unit(u.x, u.y) end
        end
 
        if (not filter.x or filter.x == "recall") and (not filter.y or filter.y 
==
"recall") then
-               for i,u in ipairs(wesnoth.get_recall_units(filter)) do
+               for i,u in ipairs(recall_units) do
                        local ucfg = u.__cfg
                        ucfg.x = "recall"
                        ucfg.y = "recall"

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?19203>

_______________________________________________
  Nachricht geschickt von/durch Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to