mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'develop' into FF/Ops
This commit is contained in:
@@ -1279,8 +1279,7 @@ function AIRBASE:GetRunwayData(magvar, mark)
|
||||
name==AIRBASE.PersianGulf.Abu_Dhabi_International_Airport or
|
||||
name==AIRBASE.PersianGulf.Dubai_Intl or
|
||||
name==AIRBASE.PersianGulf.Shiraz_International_Airport or
|
||||
name==AIRBASE.PersianGulf.Kish_International_Airport
|
||||
then
|
||||
name==AIRBASE.PersianGulf.Kish_International_Airport then
|
||||
|
||||
-- 1-->4, 2-->3, 3-->2, 4-->1
|
||||
exception=1
|
||||
@@ -1297,6 +1296,7 @@ function AIRBASE:GetRunwayData(magvar, mark)
|
||||
|
||||
end
|
||||
|
||||
--- Function returning the index of the runway coordinate belonding to the given index i.
|
||||
local function f(i)
|
||||
|
||||
local j
|
||||
@@ -1365,6 +1365,9 @@ function AIRBASE:GetRunwayData(magvar, mark)
|
||||
-- Get the other spawn point coordinate.
|
||||
local j=f(i)
|
||||
|
||||
-- Debug info.
|
||||
--env.info(string.format("Runway i=%s j=%s (N=%d #runwaycoord=%d)", tostring(i), tostring(j), N, #runwaycoords))
|
||||
|
||||
-- Coordinates of the two runway points.
|
||||
local c1=runwaycoords[i] --Core.Point#COORDINATE
|
||||
local c2=runwaycoords[j] --Core.Point#COORDINATE
|
||||
|
||||
@@ -2236,27 +2236,52 @@ function GROUP:IsAirborne(AllUnits)
|
||||
|
||||
if units then
|
||||
|
||||
for _,_unit in pairs(units) do
|
||||
local unit=_unit --Wrapper.Unit#UNIT
|
||||
|
||||
if unit then
|
||||
|
||||
-- Unit in air or not.
|
||||
local inair=unit:InAir()
|
||||
if AllUnits then
|
||||
|
||||
--- We want to know if ALL units are airborne.
|
||||
|
||||
for _,_unit in pairs(units) do
|
||||
local unit=_unit --Wrapper.Unit#UNIT
|
||||
|
||||
-- Unit is not in air and we wanted to know whether ALL units are ==> return false
|
||||
if inair==false and AllUnits==true then
|
||||
return false
|
||||
end
|
||||
if unit then
|
||||
|
||||
-- At least one unit is in are and we did not care which one.
|
||||
if inair==true and not AllUnits then
|
||||
return true
|
||||
-- Unit in air or not.
|
||||
local inair=unit:InAir()
|
||||
|
||||
-- At least one unit is not in air.
|
||||
if not inair then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
-- At least one unit is in the air.
|
||||
return true
|
||||
|
||||
-- All units are in air.
|
||||
return true
|
||||
|
||||
else
|
||||
|
||||
--- We want to know if ANY unit is airborne.
|
||||
|
||||
for _,_unit in pairs(units) do
|
||||
local unit=_unit --Wrapper.Unit#UNIT
|
||||
|
||||
if unit then
|
||||
|
||||
-- Unit in air or not.
|
||||
local inair=unit:InAir()
|
||||
|
||||
if inair then
|
||||
-- At least one unit is in air.
|
||||
return true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- No unit is in air.
|
||||
return false
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user