improve [modify_unit] [status] implementation
This commit is contained in:
parent
398ba56f77
commit
fbdd926e14
1 changed files with 7 additions and 1 deletions
|
@ -52,6 +52,7 @@ local known_tags = make_set {
|
|||
"advancement",
|
||||
"trait",
|
||||
"filter",
|
||||
"status",
|
||||
}
|
||||
|
||||
local function is_simple(cfg)
|
||||
|
@ -135,6 +136,11 @@ local function simple_modify_unit(cfg)
|
|||
end
|
||||
u:add_modification(tagname, tagcontent);
|
||||
end
|
||||
if tagname == "status" then
|
||||
for i, v in pairs(tagcontent) do
|
||||
u.status[i] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- handle 'type' last.
|
||||
|
@ -152,7 +158,7 @@ local function simple_modify_unit(cfg)
|
|||
|
||||
local this_unit = utils.start_var_scope("this_unit")
|
||||
for i, u in ipairs(get_all_units(filter)) do
|
||||
wml.variables["this_unit"] = u.__cfg
|
||||
wml.variables["this_unit"] = u.__cfg
|
||||
handle_unit(u)
|
||||
end
|
||||
utils.end_var_scope("this_unit", this_unit)
|
||||
|
|
Loading…
Add table
Reference in a new issue