mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
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:
@@ -391,9 +391,9 @@ function AI_A2A_CAP:onafterEngage( AIGroup, From, Event, To, AttackSetUnit )
|
|||||||
|
|
||||||
self.AttackSetUnit = AttackSetUnit or self.AttackSetUnit -- Core.Set#SET_UNIT
|
self.AttackSetUnit = AttackSetUnit or self.AttackSetUnit -- Core.Set#SET_UNIT
|
||||||
|
|
||||||
local FirstAttackUnit = self.AttackSetUnit:GetFirst()
|
local FirstAttackUnit = self.AttackSetUnit:GetFirst() -- Wrapper.Unit#UNIT
|
||||||
|
|
||||||
if FirstAttackUnit then
|
if FirstAttackUnit and FirstAttackUnit:IsAlive() then -- If there is no attacker anymore, stop the engagement.
|
||||||
|
|
||||||
if AIGroup:IsAlive() then
|
if AIGroup:IsAlive() then
|
||||||
|
|
||||||
|
|||||||
@@ -360,14 +360,13 @@ function AI_A2A_GCI:onafterEngage( AIGroup, From, Event, To, AttackSetUnit )
|
|||||||
|
|
||||||
local FirstAttackUnit = self.AttackSetUnit:GetFirst()
|
local FirstAttackUnit = self.AttackSetUnit:GetFirst()
|
||||||
|
|
||||||
if FirstAttackUnit then
|
if FirstAttackUnit and FirstAttackUnit:IsAlive() then
|
||||||
|
|
||||||
if AIGroup:IsAlive() then
|
if AIGroup:IsAlive() then
|
||||||
|
|
||||||
local EngageRoute = {}
|
local EngageRoute = {}
|
||||||
|
|
||||||
local CurrentCoord = AIGroup:GetCoordinate()
|
local CurrentCoord = AIGroup:GetCoordinate()
|
||||||
|
|
||||||
|
|
||||||
--- Calculate the target route point.
|
--- Calculate the target route point.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user