diff --git a/data/lua/wml-conditionals.lua b/data/lua/wml-conditionals.lua index b92ed3e6024..82db89e09f7 100644 --- a/data/lua/wml-conditionals.lua +++ b/data/lua/wml-conditionals.lua @@ -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