mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/develop' into branch
This commit is contained in:
commit
7dd67bdf0e
@ -187,7 +187,7 @@ AIRWING = {
|
||||
|
||||
--- AIRWING class version.
|
||||
-- @field #string version
|
||||
AIRWING.version="0.9.5"
|
||||
AIRWING.version="0.9.6"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- ToDo list
|
||||
@ -1365,6 +1365,8 @@ function AIRWING:CheckRescuhelo()
|
||||
|
||||
local N=self:CountMissionsInQueue({AUFTRAG.Type.RESCUEHELO})
|
||||
|
||||
if self.airbase then
|
||||
|
||||
local name=self.airbase:GetName()
|
||||
|
||||
local carrier=UNIT:FindByName(name)
|
||||
@ -1377,6 +1379,8 @@ function AIRWING:CheckRescuhelo()
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
@ -88,7 +88,10 @@ COHORT = {
|
||||
|
||||
--- COHORT class 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
|
||||
@ -110,6 +113,17 @@ COHORT.version="0.3.5"
|
||||
-- @return #COHORT self
|
||||
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.
|
||||
local self=BASE:Inherit(self, FSM:New()) -- #COHORT
|
||||
|
||||
@ -117,7 +131,7 @@ function COHORT:New(TemplateGroupName, Ngroups, CohortName)
|
||||
self.templatename=TemplateGroupName
|
||||
|
||||
-- Cohort name.
|
||||
self.name=tostring(CohortName or TemplateGroupName)
|
||||
self.name=name
|
||||
|
||||
-- Set some string id for output to DCS.log file.
|
||||
self.lid=string.format("COHORT %s | ", self.name)
|
||||
|
||||
@ -4189,51 +4189,6 @@ function FLIGHTGROUP:IsLandingAirbase(wp)
|
||||
return nil
|
||||
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.
|
||||
-- @param #FLIGHTGROUP self
|
||||
|
||||
@ -53,7 +53,7 @@ LEGION.RandomAssetScore=1
|
||||
|
||||
--- LEGION class version.
|
||||
-- @field #string version
|
||||
LEGION.version="0.5.0"
|
||||
LEGION.version="0.5.1"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- ToDo list
|
||||
@ -1827,6 +1827,9 @@ function LEGION:_CreateFlightGroup(asset)
|
||||
-- Set home base.
|
||||
opsgroup.homebase=self.airbase
|
||||
|
||||
-- Set destination base
|
||||
opsgroup.destbase=self.airbase
|
||||
|
||||
-- Set home zone.
|
||||
opsgroup.homezone=self.spawnzone
|
||||
|
||||
|
||||
@ -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.
|
||||
local destbase=self:GetDestinationFromWaypoints()
|
||||
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 dest base "..(self.destbase and self.destbase:GetName() or "unknown"))
|
||||
@ -11477,9 +11477,9 @@ function OPSGROUP:_InitWaypoints(WpIndexMin, WpIndexMax)
|
||||
end
|
||||
|
||||
-- Set destination to homebase.
|
||||
--if self.destbase==nil then -- Skipped To fix RTB issue
|
||||
-- self.destbase=self.homebase
|
||||
--end
|
||||
if self.destbase==nil then -- Skipped To fix RTB issue
|
||||
self.destbase=self.homebase
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user