Minor fixes (#1684)

* Update AI_A2A_Dispatcher.lua

Minor code formatting.

* Update Airbase.lua

Code formatting.
This commit is contained in:
TommyC81
2022-01-10 18:10:30 +04:00
committed by GitHub
parent 70d922fad6
commit c2ecd86bb4
2 changed files with 465 additions and 476 deletions
@@ -1510,7 +1510,7 @@ do -- AI_A2A_DISPATCHER
local Message = "Clearing (" .. DefenderTask.Type .. ") " local Message = "Clearing (" .. DefenderTask.Type .. ") "
Message = Message .. Defender:GetName() Message = Message .. Defender:GetName()
if Target then if Target then
Message = Message .. ( Target and ( " from " .. Target.Index .. " [" .. Target.Set:Count() .. "]" ) ) or "" Message = Message .. ((Target and (" from " .. Target.Index .. " [" .. Target.Set:Count() .. "]")) or "")
end end
self:F( { Target = Message } ) self:F( { Target = Message } )
end end
@@ -1559,7 +1559,7 @@ do -- AI_A2A_DISPATCHER
local Message = "(" .. self.DefenderTasks[Defender].Type .. ") " local Message = "(" .. self.DefenderTasks[Defender].Type .. ") "
Message = Message .. Defender:GetName() Message = Message .. Defender:GetName()
Message = Message .. ( AttackerDetection and ( " target " .. AttackerDetection.Index .. " [" .. AttackerDetection.Set:Count() .. "]" ) ) or "" Message = Message .. ((AttackerDetection and (" target " .. AttackerDetection.Index .. " [" .. AttackerDetection.Set:Count() .. "]")) or "")
self:F( { AttackerDetection = Message } ) self:F( { AttackerDetection = Message } )
if AttackerDetection then if AttackerDetection then
self.DefenderTasks[Defender].Target = AttackerDetection self.DefenderTasks[Defender].Target = AttackerDetection
+3 -14
View File
@@ -11,7 +11,6 @@
-- @module Wrapper.Airbase -- @module Wrapper.Airbase
-- @image Wrapper_Airbase.JPG -- @image Wrapper_Airbase.JPG
--- @type AIRBASE --- @type AIRBASE
-- @field #string ClassName Name of the class, i.e. "AIRBASE". -- @field #string ClassName Name of the class, i.e. "AIRBASE".
-- @field #table CategoryName Names of airbase categories. -- @field #table CategoryName Names of airbase categories.
@@ -52,7 +51,7 @@
-- * @{#AIRBASE.Find}(): Find a AIRBASE instance from the _DATABASE object using a DCS Airbase object. -- * @{#AIRBASE.Find}(): Find a AIRBASE instance from the _DATABASE object using a DCS Airbase object.
-- * @{#AIRBASE.FindByName}(): Find a AIRBASE instance from the _DATABASE object using a DCS Airbase name. -- * @{#AIRBASE.FindByName}(): Find a AIRBASE instance from the _DATABASE object using a DCS Airbase name.
-- --
-- IMPORTANT: ONE SHOULD NEVER SANATIZE these AIRBASE OBJECT REFERENCES! (make the AIRBASE object references nil). -- IMPORTANT: ONE SHOULD NEVER SANITIZE these AIRBASE OBJECT REFERENCES! (make the AIRBASE object references nil).
-- --
-- ## DCS Airbase APIs -- ## DCS Airbase APIs
-- --
@@ -442,8 +441,6 @@ AIRBASE.Syria={
["Abu_al_Duhur"] = "Abu al-Duhur", ["Abu_al_Duhur"] = "Abu al-Duhur",
} }
--- Airbases of the Mariana Islands map: --- Airbases of the Mariana Islands map:
-- --
-- * AIRBASE.MarianaIslands.Rota_Intl -- * AIRBASE.MarianaIslands.Rota_Intl
@@ -463,7 +460,6 @@ AIRBASE.MarianaIslands={
["Olf_Orote"] = "Olf Orote", ["Olf_Orote"] = "Olf Orote",
} }
--- AIRBASE.ParkingSpot ".Coordinate, ".TerminalID", ".TerminalType", ".TOAC", ".Free", ".TerminalID0", ".DistToRwy". --- AIRBASE.ParkingSpot ".Coordinate, ".TerminalID", ".TerminalType", ".TOAC", ".Free", ".TerminalID0", ".DistToRwy".
-- @type AIRBASE.ParkingSpot -- @type AIRBASE.ParkingSpot
-- @field Core.Point#COORDINATE Coordinate Coordinate of the parking spot. -- @field Core.Point#COORDINATE Coordinate Coordinate of the parking spot.
@@ -772,7 +768,6 @@ function AIRBASE:SetParkingSpotBlacklist(TerminalIdBlacklist)
return self return self
end end
--- Get category of airbase. --- Get category of airbase.
-- @param #AIRBASE self -- @param #AIRBASE self
-- @return #number Category of airbase from GetDesc().category. -- @return #number Category of airbase from GetDesc().category.
@@ -1112,8 +1107,7 @@ function AIRBASE:MarkParkingSpots(termtype, mark)
for _, _spot in pairs( parkingdata ) do for _, _spot in pairs( parkingdata ) do
-- Mark text. -- Mark text.
local _text=string.format("Term Index=%d, Term Type=%d, Free=%s, TOAC=%s, Term ID0=%d, Dist2Rwy=%.1f m", local _text = string.format( "Term Index=%d, Term Type=%d, Free=%s, TOAC=%s, Term ID0=%d, Dist2Rwy=%.1f m", _spot.TerminalID, _spot.TerminalType, tostring( _spot.Free ), tostring( _spot.TOAC ), _spot.TerminalID0, _spot.DistToRwy )
_spot.TerminalID, _spot.TerminalType,tostring(_spot.Free),tostring(_spot.TOAC),_spot.TerminalID0,_spot.DistToRwy)
-- Create mark on the F10 map. -- Create mark on the F10 map.
if mark then if mark then
@@ -1121,8 +1115,7 @@ function AIRBASE:MarkParkingSpots(termtype, mark)
end end
-- Info to DCS.log file. -- Info to DCS.log file.
local _text=string.format("%s, Term Index=%3d, Term Type=%03d, Free=%5s, TOAC=%5s, Term ID0=%3d, Dist2Rwy=%.1f m", local _text = string.format( "%s, Term Index=%3d, Term Type=%03d, Free=%5s, TOAC=%5s, Term ID0=%3d, Dist2Rwy=%.1f m", airbasename, _spot.TerminalID, _spot.TerminalType, tostring( _spot.Free ), tostring( _spot.TOAC ), _spot.TerminalID0, _spot.DistToRwy )
airbasename, _spot.TerminalID, _spot.TerminalType,tostring(_spot.Free),tostring(_spot.TOAC),_spot.TerminalID0,_spot.DistToRwy)
self:E( _text ) self:E( _text )
end end
end end
@@ -1197,7 +1190,6 @@ function AIRBASE:FindFreeParkingSpotForAircraft(group, terminaltype, scanradius,
az = 17 -- width az = 17 -- width
end end
-- Number of spots we are looking for. Note that, e.g. grouping can require a number different from the group size! -- Number of spots we are looking for. Note that, e.g. grouping can require a number different from the group size!
local _nspots = nspots or group:GetSize() local _nspots = nspots or group:GetSize()
@@ -1344,7 +1336,6 @@ function AIRBASE:_CheckParkingLists(TerminalID)
end end
end end
-- Check if a whitelist was defined. -- Check if a whitelist was defined.
if self.parkingWhitelist and #self.parkingWhitelist > 0 then if self.parkingWhitelist and #self.parkingWhitelist > 0 then
for _, terminalID in pairs( self.parkingWhitelist or {} ) do for _, terminalID in pairs( self.parkingWhitelist or {} ) do
@@ -1447,7 +1438,6 @@ function AIRBASE:GetRunwayData(magvar, mark)
-- Airbase name. -- Airbase name.
local name = self:GetName() local name = self:GetName()
-- Exceptions -- Exceptions
if name == AIRBASE.Nevada.Jean_Airport or if name == AIRBASE.Nevada.Jean_Airport or
name == AIRBASE.Nevada.Creech_AFB or name == AIRBASE.Nevada.Creech_AFB or
@@ -1535,7 +1525,6 @@ function AIRBASE:GetRunwayData(magvar, mark)
return j return j
end end
for i = 1, N do for i = 1, N do
-- Get the other spawn point coordinate. -- Get the other spawn point coordinate.