Propagate modifications to item_var back into the array

This commit is contained in:
Celtic Minstrel 2015-08-23 17:17:57 -04:00
parent 6c5cf1eb88
commit 65263bfc32

View file

@ -371,6 +371,10 @@ function wml_actions.foreach(cfg)
for do_child in helper.child_range(cfg, "do") do
handle_event_commands(do_child, "loop")
end
-- set back the content, in case the author made some modifications
if not cfg.readonly then
array[index] = wesnoth.get_variable(item_name)
end
end
-- house cleaning