Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Applevangelist 2024-12-12 13:11:58 +01:00
commit ea55e90e62
8 changed files with 88 additions and 63 deletions

View File

@ -498,6 +498,9 @@ ATIS.Alphabet = {
-- @field #number Syria +5° (East). -- @field #number Syria +5° (East).
-- @field #number MarianaIslands +2° (East). -- @field #number MarianaIslands +2° (East).
-- @field #number SinaiMap +5° (East). -- @field #number SinaiMap +5° (East).
-- @field #number Kola +15° (East).
-- @field #number Afghanistan +3° (East).
-- @field #number Iraq +4.4° (East).
ATIS.RunwayM2T = { ATIS.RunwayM2T = {
Caucasus = 0, Caucasus = 0,
Nevada = 12, Nevada = 12,
@ -508,6 +511,9 @@ ATIS.RunwayM2T = {
MarianaIslands = 2, MarianaIslands = 2,
Falklands = 12, Falklands = 12,
SinaiMap = 5, SinaiMap = 5,
Kola = 15,
Afghanistan = 3,
Iraq=4.4
} }
--- Whether ICAO phraseology is used for ATIS broadcasts. --- Whether ICAO phraseology is used for ATIS broadcasts.
@ -521,6 +527,9 @@ ATIS.RunwayM2T = {
-- @field #boolean MarianaIslands true. -- @field #boolean MarianaIslands true.
-- @field #boolean Falklands true. -- @field #boolean Falklands true.
-- @field #boolean SinaiMap true. -- @field #boolean SinaiMap true.
-- @field #boolean Kola true.
-- @field #boolean Afghanistan true.
-- @field #boolean Iraq true.
ATIS.ICAOPhraseology = { ATIS.ICAOPhraseology = {
Caucasus = true, Caucasus = true,
Nevada = false, Nevada = false,
@ -531,6 +540,9 @@ ATIS.ICAOPhraseology = {
MarianaIslands = true, MarianaIslands = true,
Falklands = true, Falklands = true,
SinaiMap = true, SinaiMap = true,
Kola = true,
Afghanistan = true,
Iraq = true,
} }
--- Nav point data. --- Nav point data.

View File

@ -187,7 +187,7 @@ AIRWING = {
--- AIRWING class version. --- AIRWING class version.
-- @field #string version -- @field #string version
AIRWING.version="0.9.5" AIRWING.version="0.9.6"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ToDo list -- ToDo list
@ -1365,15 +1365,19 @@ function AIRWING:CheckRescuhelo()
local N=self:CountMissionsInQueue({AUFTRAG.Type.RESCUEHELO}) local N=self:CountMissionsInQueue({AUFTRAG.Type.RESCUEHELO})
local name=self.airbase:GetName() if self.airbase then
local carrier=UNIT:FindByName(name) local name=self.airbase:GetName()
for i=1,self.nflightsRescueHelo-N do local carrier=UNIT:FindByName(name)
local mission=AUFTRAG:NewRESCUEHELO(carrier) for i=1,self.nflightsRescueHelo-N do
self:AddMission(mission) local mission=AUFTRAG:NewRESCUEHELO(carrier)
self:AddMission(mission)
end
end end

View File

@ -88,7 +88,10 @@ COHORT = {
--- COHORT class version. --- COHORT class version.
-- @field #string version -- @field #string version
COHORT.version="0.3.5" COHORT.version="0.3.6"
--- Global variable to store the unique(!) cohort names
_COHORTNAMES={}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list -- TODO list
@ -110,6 +113,17 @@ COHORT.version="0.3.5"
-- @return #COHORT self -- @return #COHORT self
function COHORT:New(TemplateGroupName, Ngroups, CohortName) function COHORT:New(TemplateGroupName, Ngroups, CohortName)
-- Name of the cohort.
local name=tostring(CohortName or TemplateGroupName)
-- Cohort name has to be unique or we will get serious problems!
if UTILS.IsAnyInTable(_COHORTNAMES, name) then
env.error(string.format('ERROR: cannot create cohort "%s" because another cohort with that name already exists. Names must be unique!', name))
return nil
else
table.insert(_COHORTNAMES, name)
end
-- Inherit everything from FSM class. -- Inherit everything from FSM class.
local self=BASE:Inherit(self, FSM:New()) -- #COHORT local self=BASE:Inherit(self, FSM:New()) -- #COHORT
@ -117,7 +131,7 @@ function COHORT:New(TemplateGroupName, Ngroups, CohortName)
self.templatename=TemplateGroupName self.templatename=TemplateGroupName
-- Cohort name. -- Cohort name.
self.name=tostring(CohortName or TemplateGroupName) self.name=name
-- Set some string id for output to DCS.log file. -- Set some string id for output to DCS.log file.
self.lid=string.format("COHORT %s | ", self.name) self.lid=string.format("COHORT %s | ", self.name)

View File

@ -4189,51 +4189,6 @@ function FLIGHTGROUP:IsLandingAirbase(wp)
return nil return nil
end end
--- Initialize Mission Editor waypoints.
-- @param #FLIGHTGROUP self
-- @return #FLIGHTGROUP self
function FLIGHTGROUP:InitWaypoints()
-- Template waypoints.
self.waypoints0=self.group:GetTemplateRoutePoints()
-- Waypoints
self.waypoints={}
for index,wp in pairs(self.waypoints0) do
local waypoint=self:_CreateWaypoint(wp)
self:_AddWaypoint(waypoint)
end
-- Get home and destination airbases from waypoints.
self.homebase=self.homebase or self:GetHomebaseFromWaypoints()
self.destbase=self.destbase or self:GetDestinationFromWaypoints()
self.currbase=self:GetHomebaseFromWaypoints()
-- Remove the landing waypoint. We use RTB for that. It makes adding new waypoints easier as we do not have to check if the last waypoint is the landing waypoint.
if self.destbase and #self.waypoints>1 then
table.remove(self.waypoints, #self.waypoints)
else
self.destbase=self.homebase
end
-- Debug info.
self:T(self.lid..string.format("Initializing %d waypoints. Homebase %s ==> %s Destination", #self.waypoints, self.homebase and self.homebase:GetName() or "unknown", self.destbase and self.destbase:GetName() or "uknown"))
-- Update route.
if #self.waypoints>0 then
-- Check if only 1 wp?
if #self.waypoints==1 then
self:_PassedFinalWaypoint(true, "FLIGHTGROUP:InitWaypoints #self.waypoints==1")
end
end
return self
end
--- Add an AIR waypoint to the flight plan. --- Add an AIR waypoint to the flight plan.
-- @param #FLIGHTGROUP self -- @param #FLIGHTGROUP self

View File

@ -53,7 +53,7 @@ LEGION.RandomAssetScore=1
--- LEGION class version. --- LEGION class version.
-- @field #string version -- @field #string version
LEGION.version="0.5.0" LEGION.version="0.5.1"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ToDo list -- ToDo list
@ -1827,6 +1827,9 @@ function LEGION:_CreateFlightGroup(asset)
-- Set home base. -- Set home base.
opsgroup.homebase=self.airbase opsgroup.homebase=self.airbase
-- Set destination base
opsgroup.destbase=self.airbase
-- Set home zone. -- Set home zone.
opsgroup.homezone=self.spawnzone opsgroup.homezone=self.spawnzone

View File

@ -11466,7 +11466,7 @@ function OPSGROUP:_InitWaypoints(WpIndexMin, WpIndexMax)
self.homebase=self.homebase or self:GetHomebaseFromWaypoints() -- GetHomebaseFromWaypoints() returns carriers or destroyers if no airbase is found. self.homebase=self.homebase or self:GetHomebaseFromWaypoints() -- GetHomebaseFromWaypoints() returns carriers or destroyers if no airbase is found.
local destbase=self:GetDestinationFromWaypoints() local destbase=self:GetDestinationFromWaypoints()
self.destbase=self.destbase or destbase self.destbase=self.destbase or destbase
--self.currbase=self:GetHomebaseFromWaypoints() -- Skipped To fix RTB issue self.currbase=self:GetHomebaseFromWaypoints() -- Skipped To fix RTB issue
--env.info("FF home base "..(self.homebase and self.homebase:GetName() or "unknown")) --env.info("FF home base "..(self.homebase and self.homebase:GetName() or "unknown"))
--env.info("FF dest base "..(self.destbase and self.destbase:GetName() or "unknown")) --env.info("FF dest base "..(self.destbase and self.destbase:GetName() or "unknown"))
@ -11477,9 +11477,9 @@ function OPSGROUP:_InitWaypoints(WpIndexMin, WpIndexMax)
end end
-- Set destination to homebase. -- Set destination to homebase.
--if self.destbase==nil then -- Skipped To fix RTB issue if self.destbase==nil then -- Skipped To fix RTB issue
-- self.destbase=self.homebase self.destbase=self.homebase
--end end
end end

View File

@ -56,6 +56,8 @@ BIGSMOKEPRESET = {
-- @field #string Falklands South Atlantic map. -- @field #string Falklands South Atlantic map.
-- @field #string Sinai Sinai map. -- @field #string Sinai Sinai map.
-- @field #string Kola Kola map. -- @field #string Kola Kola map.
-- @field #string Afghanistan Afghanistan map
-- @field #string Iraq Iraq map
DCSMAP = { DCSMAP = {
Caucasus="Caucasus", Caucasus="Caucasus",
NTTR="Nevada", NTTR="Nevada",
@ -68,6 +70,7 @@ DCSMAP = {
Sinai="SinaiMap", Sinai="SinaiMap",
Kola="Kola", Kola="Kola",
Afghanistan="Afghanistan", Afghanistan="Afghanistan",
Iraq="Iraq"
} }
@ -1786,6 +1789,8 @@ function UTILS.GetMagneticDeclination(map)
declination=15 declination=15
elseif map==DCSMAP.Afghanistan then elseif map==DCSMAP.Afghanistan then
declination=3 declination=3
elseif map==DCSMAP.Iraq then
declination=4.4
else else
declination=0 declination=0
end end

View File

@ -853,6 +853,38 @@ AIRBASE.Afghanistan = {
["Tarinkot"] = "Tarinkot", ["Tarinkot"] = "Tarinkot",
} }
--- Airbases of the Iraq map
--
-- * `AIRBASE.Iraq.Baghdad_International_Airport` Baghdad International Airport
-- * `AIRBASE.Iraq.Sulaimaniyah_International_Airport` Sulaimaniyah International Airport
-- * `AIRBASE.Iraq.Al_Sahra_Airport` Al-Sahra Airport
-- * `AIRBASE.Iraq.Erbil_International_Airport` Erbil International Airport
-- * `AIRBASE.Iraq.Al_Taji_Airport` Al-Taji Airport
-- * `AIRBASE.Iraq.Al_Asad_Airbase` Al-Asad Airbase
-- * `AIRBASE.Iraq.Al_Salam_Airbase` Al-Salam Airbase
-- * `AIRBASE.Iraq.Balad_Airbase` Balad Airbase
-- * `AIRBASE.Iraq.Kirkuk_International_Airport` Kirkuk International Airport
-- * `AIRBASE.Iraq.Bashur_Airport` Bashur Airport
-- * `AIRBASE.Iraq.Al_Taquddum_Airport` Al-Taquddum Airport
-- * `AIRBASE.Iraq.Qayyarah_Airfield_West` Qayyarah Airfield West
-- * `AIRBASE.Iraq.K1_Base` K1 Base
--
AIRBASE.Iraq = {
["Baghdad_International_Airport"] = "Baghdad International Airport",
["Sulaimaniyah_International_Airport"] = "Sulaimaniyah International Airport",
["Al_Sahra_Airport"] = "Al-Sahra Airport",
["Erbil_International_Airport"] = "Erbil International Airport",
["Al_Taji_Airport"] = "Al-Taji Airport",
["Al_Asad_Airbase"] = "Al-Asad Airbase",
["Al_Salam_Airbase"] = "Al-Salam Airbase",
["Balad_Airbase"] = "Balad Airbase",
["Kirkuk_International_Airport"] = "Kirkuk International Airport",
["Bashur_Airport"] = "Bashur Airport",
["Al_Taquddum_Airport"] = "Al-Taquddum Airport",
["Qayyarah_Airfield_West"] = "Qayyarah Airfield West",
["K1_Base"] = "K1 Base",
}
--- 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.