Merge branch 'master' into FF/Fox2

This commit is contained in:
Frank
2020-06-05 00:04:01 +02:00
+12 -12
View File
@@ -311,7 +311,7 @@ AIRBASE.PersianGulf = {
-- * AIRBASE.TheChannel.Lympne -- * AIRBASE.TheChannel.Lympne
-- * AIRBASE.TheChannel.Detling -- * AIRBASE.TheChannel.Detling
-- * AIRBASE.TheChannel.High_Halden -- * AIRBASE.TheChannel.High_Halden
-- --
-- @field TheChannel -- @field TheChannel
AIRBASE.TheChannel = { AIRBASE.TheChannel = {
["Abbeville_Drucat"] = "Abbeville Drucat", ["Abbeville_Drucat"] = "Abbeville Drucat",
@@ -403,13 +403,13 @@ AIRBASE.TerminalType = {
function AIRBASE:Register( AirbaseName ) function AIRBASE:Register( AirbaseName )
local self = BASE:Inherit( self, POSITIONABLE:New( AirbaseName ) ) --#AIRBASE local self = BASE:Inherit( self, POSITIONABLE:New( AirbaseName ) ) --#AIRBASE
-- Airbase name. -- Airbase name.
self.AirbaseName = AirbaseName self.AirbaseName = AirbaseName
-- Airbase unique ID. -- Airbase unique ID.
self.AirbaseID = self:GetID(true) self.AirbaseID = self:GetID(true)
-- Airbase category. -- Airbase category.
local desc=self:GetDesc() local desc=self:GetDesc()
local category=Airbase.Category.AIRDROME local category=Airbase.Category.AIRDROME
@@ -419,10 +419,10 @@ function AIRBASE:Register( AirbaseName )
self:E(string.format("ERROR: Cannot get category of airbase %s due to DCS 2.5.6 bug! Assuming it is an AIRDROME for now...", tostring(self.AirbaseName))) self:E(string.format("ERROR: Cannot get category of airbase %s due to DCS 2.5.6 bug! Assuming it is an AIRDROME for now...", tostring(self.AirbaseName)))
end end
self.AirbaseCategory=category self.AirbaseCategory=category
-- Category name. -- Category name.
self.AirbaseCategoryName=AIRBASE.CategoryName[self.AirbaseCategory] self.AirbaseCategoryName=AIRBASE.CategoryName[self.AirbaseCategory]
-- Airbase zone. -- Airbase zone.
if self.AirbaseCategory==Airbase.Category.SHIP then if self.AirbaseCategory==Airbase.Category.SHIP then
local unit=UNIT:FindByName(AirbaseName) local unit=UNIT:FindByName(AirbaseName)
@@ -747,29 +747,29 @@ function AIRBASE:GetParkingSpotsTable(termtype)
end end
return false return false
end end
-- Get client coordinates. -- Get client coordinates.
local function _isclient(_coord) local function _isclient(_coord)
for clientname, client in pairs(_DATABASE.CLIENTS) do for clientname, client in pairs(_DATABASE.CLIENTS) do
local template=_DATABASE:GetGroupTemplateFromUnitName(clientname) local template=_DATABASE:GetGroupTemplateFromUnitName(clientname)
local units=template.units local units=template.units
for i,unit in pairs(units) do for i,unit in pairs(units) do
-- Unit coordinate. -- Unit coordinate.
local coord=COORDINATE:New(unit.x, unit.alt, unit.y) local coord=COORDINATE:New(unit.x, unit.alt, unit.y)
-- Distance to parking spot. -- Distance to parking spot.
local dist=coord:Get2DDistance(_coord) local dist=coord:Get2DDistance(_coord)
if dist<=5 then if dist<=5 then
return clientname return clientname
end end
end end
end end
return nil return nil
end end
-- Put coordinates of parking spots into table. -- Put coordinates of parking spots into table.
local spots={} local spots={}