From ee6954a4b95f56b060eab09117af2539ced06e4e Mon Sep 17 00:00:00 2001 From: Frank Date: Thu, 17 Dec 2020 13:54:59 +0100 Subject: [PATCH] Update AI_Air_Engage.lua - Changed :Count to :CountAlive for AttackSetUnit. Issue #1393 --- Moose Development/Moose/AI/AI_Air_Engage.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/AI/AI_Air_Engage.lua b/Moose Development/Moose/AI/AI_Air_Engage.lua index 2679d472d..03a693ddf 100644 --- a/Moose Development/Moose/AI/AI_Air_Engage.lua +++ b/Moose Development/Moose/AI/AI_Air_Engage.lua @@ -418,6 +418,7 @@ end -- @param #string From The From State string. -- @param #string Event The Event string. -- @param #string To The To State string. +-- @param Core.Set#SET_UNIT AttackSetUnit Unit set to be attacked. function AI_AIR_ENGAGE:onafterEngageRoute( DefenderGroup, From, Event, To, AttackSetUnit ) self:I( { DefenderGroup, From, Event, To, AttackSetUnit } ) @@ -425,7 +426,7 @@ function AI_AIR_ENGAGE:onafterEngageRoute( DefenderGroup, From, Event, To, Attac self.AttackSetUnit = AttackSetUnit -- Kept in memory in case of resume from refuel in air! - local AttackCount = AttackSetUnit:Count() + local AttackCount = AttackSetUnit:CountAlive() if AttackCount > 0 then @@ -510,6 +511,7 @@ end -- @param #string From The From State string. -- @param #string Event The Event string. -- @param #string To The To State string. +-- @param Core.Set#SET_UNIT AttackSetUnit Set of units to be attacked. function AI_AIR_ENGAGE:onafterEngage( DefenderGroup, From, Event, To, AttackSetUnit ) self:F( { DefenderGroup, From, Event, To, AttackSetUnit} ) @@ -517,8 +519,8 @@ function AI_AIR_ENGAGE:onafterEngage( DefenderGroup, From, Event, To, AttackSetU self.AttackSetUnit = AttackSetUnit -- Kept in memory in case of resume from refuel in air! - local AttackCount = AttackSetUnit:Count() - self:I({AttackCount = AttackCount}) + local AttackCount = AttackSetUnit:CountAlive()() + self:T({AttackCount = AttackCount}) if AttackCount > 0 then