Support as_type=weapon in [variable]formula=
This commit is contained in:
parent
bb8b710676
commit
6d3dd6a175
1 changed files with 2 additions and 1 deletions
|
@ -27,7 +27,8 @@ function wesnoth.wml_conditionals.variable(cfg)
|
|||
local value = wml.variables[cfg.name]
|
||||
if cfg.as_type == 'unit' then
|
||||
value = wesnoth.units.create(value)
|
||||
-- TODO: Consider supporting other types.
|
||||
elseif cfg.as_type == 'weapon' then
|
||||
value = wesnoth.units.create_weapon(value)
|
||||
end
|
||||
local result = wesnoth.eval_formula(cfg.formula, {value = value})
|
||||
-- WFL considers 0 as false; Lua doesn't
|
||||
|
|
Loading…
Add table
Reference in a new issue