mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
GROUP - making GetCoordinate() a bit more resilient
POINT - slight changes to ToStringBRAANATO
This commit is contained in:
@@ -2799,9 +2799,9 @@ do -- COORDINATE
|
|||||||
end
|
end
|
||||||
if Bogey and Spades then
|
if Bogey and Spades then
|
||||||
BRAANATO = BRAANATO..", Bogey, Spades."
|
BRAANATO = BRAANATO..", Bogey, Spades."
|
||||||
elseif Bogey and (not Spades) then
|
elseif Bogey then
|
||||||
BRAANATO = BRAANATO..", Bogey."
|
BRAANATO = BRAANATO..", Bogey."
|
||||||
elseif (not Bogey) and Spades then
|
elseif Spades then
|
||||||
BRAANATO = BRAANATO..", Spades."
|
BRAANATO = BRAANATO..", Spades."
|
||||||
else
|
else
|
||||||
BRAANATO = BRAANATO.."."
|
BRAANATO = BRAANATO.."."
|
||||||
|
|||||||
@@ -1019,18 +1019,25 @@ end
|
|||||||
-- @return Core.Point#COORDINATE The COORDINATE of the GROUP.
|
-- @return Core.Point#COORDINATE The COORDINATE of the GROUP.
|
||||||
function GROUP:GetCoordinate()
|
function GROUP:GetCoordinate()
|
||||||
|
|
||||||
local FirstUnit = self:GetUnit(1)
|
local Units = self:GetUnits()
|
||||||
|
|
||||||
if FirstUnit then
|
for _,_unit in pairs(Units) do
|
||||||
local FirstUnitCoordinate = FirstUnit:GetCoordinate()
|
local FirstUnit = _unit -- Wrapper.Unit#UNIT
|
||||||
local Heading = self:GetHeading()
|
|
||||||
FirstUnitCoordinate.Heading = Heading
|
if FirstUnit then
|
||||||
return FirstUnitCoordinate
|
|
||||||
|
local FirstUnitCoordinate = FirstUnit:GetCoordinate()
|
||||||
|
|
||||||
|
if FirstUnitCoordinate then
|
||||||
|
local Heading = self:GetHeading()
|
||||||
|
FirstUnitCoordinate.Heading = Heading
|
||||||
|
return FirstUnitCoordinate
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
BASE:E( { "Cannot GetCoordinate", Group = self, Alive = self:IsAlive() } )
|
BASE:E( { "Cannot GetCoordinate", Group = self, Alive = self:IsAlive() } )
|
||||||
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user