Solve calculation problems with player has disconnected or changed plane

* Player disconnecting will not result in coordinate calculation
problems in AI_A2A_CAP and AI_A2A_GCI while engaged with the player
machine. The engagement will stop.
This commit is contained in:
FlightControl_Master
2017-09-02 09:22:23 +02:00
parent c2965e0736
commit e6c765c441
2 changed files with 3 additions and 4 deletions

View File

@@ -360,14 +360,13 @@ function AI_A2A_GCI:onafterEngage( AIGroup, From, Event, To, AttackSetUnit )
local FirstAttackUnit = self.AttackSetUnit:GetFirst()
if FirstAttackUnit then
if FirstAttackUnit and FirstAttackUnit:IsAlive() then
if AIGroup:IsAlive() then
local EngageRoute = {}
local CurrentCoord = AIGroup:GetCoordinate()
--- Calculate the target route point.