[harm_unit]: moved support function bool() to the start of the tag
This change is needed to have the function available for the whole tag.
This commit is contained in:
parent
81aac64fc2
commit
dae1b121a6
1 changed files with 7 additions and 4 deletions
|
@ -775,6 +775,13 @@ function wml_actions.harm_unit(cfg)
|
|||
-- #textdomain wesnoth
|
||||
local harmer
|
||||
|
||||
local function bool( value ) -- helper for animate fields
|
||||
+ -- units will be animated upon leveling or killing, even
|
||||
+ -- with special attacker and defender values
|
||||
if value then return true
|
||||
else return false end
|
||||
end
|
||||
|
||||
local this_unit = start_var_scope("this_unit")
|
||||
|
||||
for index, unit_to_harm in ipairs(wesnoth.get_units(filter)) do
|
||||
|
@ -912,10 +919,6 @@ function wml_actions.harm_unit(cfg)
|
|||
end
|
||||
|
||||
if kill ~= false and unit_to_harm.hitpoints <= 0 then
|
||||
local function bool( value ) -- support function for kill tag below
|
||||
if value then return true
|
||||
else return false end
|
||||
end
|
||||
wml_actions.kill({ id = unit_to_harm.id, animate = bool( animate ), fire_event = fire_event })
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue