mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
OPS
- Added nil check on vec3 for _UndateEngageTarget in ARMYGROUP and NAVYGROUP
This commit is contained in:
parent
0411120551
commit
f92e8a285a
@ -1476,6 +1476,8 @@ function ARMYGROUP:_UpdateEngageTarget()
|
||||
-- Get current position vector.
|
||||
local vec3=self.engage.Target:GetVec3()
|
||||
|
||||
if vec3 then
|
||||
|
||||
-- Distance to last known position of target.
|
||||
local dist=UTILS.VecDist3D(vec3, self.engage.Coordinate:GetVec3())
|
||||
|
||||
@ -1505,7 +1507,14 @@ function ARMYGROUP:_UpdateEngageTarget()
|
||||
|
||||
else
|
||||
|
||||
-- Target not alive any more == Disengage.
|
||||
-- Could not get position of target (not alive any more?) ==> Disengage.
|
||||
self:Disengage()
|
||||
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
-- Target not alive any more ==> Disengage.
|
||||
self:Disengage()
|
||||
|
||||
end
|
||||
|
||||
@ -1440,6 +1440,8 @@ function NAVYGROUP:_UpdateEngageTarget()
|
||||
-- Get current position vector.
|
||||
local vec3=self.engage.Target:GetVec3()
|
||||
|
||||
if vec3 then
|
||||
|
||||
-- Distance to last known position of target.
|
||||
local dist=UTILS.VecDist3D(vec3, self.engage.Coordinate:GetVec3())
|
||||
|
||||
@ -1469,7 +1471,14 @@ function NAVYGROUP:_UpdateEngageTarget()
|
||||
|
||||
else
|
||||
|
||||
-- Target not alive any more == Disengage.
|
||||
-- Could not get position of target (not alive any more?) ==> Disengage.
|
||||
self:Disengage()
|
||||
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
-- Target not alive any more ==> Disengage.
|
||||
self:Disengage()
|
||||
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user