Fixed [store_unit]mode=replace clearing the variable...
...even if no units are found. Array entries are cleared as far as neccessary now (if the array was longer those entries remain).
This commit is contained in:
parent
59c475d4d8
commit
7a73632541
1 changed files with 3 additions and 2 deletions
|
@ -336,12 +336,13 @@ function wml_actions.store_unit(cfg)
|
|||
local filter = helper.get_child(cfg, "filter") or
|
||||
helper.wml_error "[store_unit] missing required [filter] tag"
|
||||
local kill_units = cfg.kill
|
||||
local mode = cfg.mode
|
||||
|
||||
local var = cfg.variable or "unit"
|
||||
local idx = 0
|
||||
if cfg.mode == "append" then
|
||||
if mode == "append" then
|
||||
idx = wesnoth.get_variable(var .. ".length")
|
||||
else
|
||||
elseif mode ~= "replace" then
|
||||
wesnoth.set_variable(var)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue