mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
#FG - added nil check on GetClosestAirbase()
This commit is contained in:
parent
6e666b0ac8
commit
ff58a47244
@ -4152,13 +4152,21 @@ end
|
|||||||
function FLIGHTGROUP:GetClosestAirbase()
|
function FLIGHTGROUP:GetClosestAirbase()
|
||||||
|
|
||||||
local group=self.group --Wrapper.Group#GROUP
|
local group=self.group --Wrapper.Group#GROUP
|
||||||
|
|
||||||
local coord=group:GetCoordinate()
|
if group and group:IsAlive() then
|
||||||
local coalition=self:GetCoalition()
|
|
||||||
|
local coord=group:GetCoordinate()
|
||||||
local airbase=coord:GetClosestAirbase() --(nil, coalition)
|
local coalition=self:GetCoalition()
|
||||||
|
|
||||||
return airbase
|
local airbase=coord:GetClosestAirbase() --(nil, coalition)
|
||||||
|
|
||||||
|
return airbase
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
return nil
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Search unoccupied parking spots at the airbase for all flight elements.
|
--- Search unoccupied parking spots at the airbase for all flight elements.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user