mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#FG - nil check on GetClosestAirbase()
This commit is contained in:
parent
8648b0a24d
commit
df9a572656
@ -216,7 +216,7 @@ FLIGHTGROUP.Players={}
|
||||
|
||||
--- FLIGHTGROUP class version.
|
||||
-- @field #string version
|
||||
FLIGHTGROUP.version="0.8.4"
|
||||
FLIGHTGROUP.version="0.8.5"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@ -4153,12 +4153,20 @@ function FLIGHTGROUP:GetClosestAirbase()
|
||||
|
||||
local group=self.group --Wrapper.Group#GROUP
|
||||
|
||||
if group and group:IsAlive() then
|
||||
|
||||
local coord=group:GetCoordinate()
|
||||
local coalition=self:GetCoalition()
|
||||
|
||||
local airbase=coord:GetClosestAirbase() --(nil, coalition)
|
||||
|
||||
return airbase
|
||||
|
||||
else
|
||||
|
||||
return nil
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
--- Search unoccupied parking spots at the airbase for all flight elements.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user