From 390d1fdc10cd9fb878186fb1c123cd1e343bdb6d Mon Sep 17 00:00:00 2001 From: mattsc Date: Sat, 3 Sep 2016 07:03:00 -0700 Subject: [PATCH] High XP CA: simplify attack conditions with 1.13 syntax --- data/ai/lua/ca_high_xp_attack.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/ai/lua/ca_high_xp_attack.lua b/data/ai/lua/ca_high_xp_attack.lua index 2e7c48fd06c..15aed88564c 100644 --- a/data/ai/lua/ca_high_xp_attack.lua +++ b/data/ai/lua/ca_high_xp_attack.lua @@ -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