High XP CA: simplify attack conditions with 1.13 syntax

This commit is contained in:
mattsc 2016-09-03 07:03:00 -07:00
parent 6950ee1dd0
commit 390d1fdc10

View File

@ -37,7 +37,7 @@ function ca_attack_highxp:evaluation(cfg, data)
local max_unit_level = 0
local units = {}
for _,unit in ipairs(all_units) do
if (unit.side == wesnoth.current.side) and (unit.attacks_left > 0) and (H.get_child(unit.__cfg, 'attack')) then
if (unit.side == wesnoth.current.side) and (unit.attacks_left > 0) and (#unit.attacks > 0) then
table.insert(units, unit)
local level = wesnoth.unit_types[unit.type].level