mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-07-20 22:03:25 +00:00
Ops
This commit is contained in:
@@ -102,11 +102,11 @@ AIRWING.version="0.1.5"
|
||||
-- TODO: Make special request to transfer squadrons to anther airwing (or warehouse).
|
||||
-- DONE: Build mission queue.
|
||||
-- DONE: Find way to start missions.
|
||||
-- TODO: Check if missions are done/cancelled.
|
||||
-- DONE: Check if missions are done/cancelled.
|
||||
-- DONE: Payloads as resources.
|
||||
-- TODO: Spawn in air or hot.
|
||||
-- TODO: Define CAP zones.
|
||||
-- TODO: Define TANKER zones for refuelling.
|
||||
-- DONE: Define CAP zones.
|
||||
-- DONE: Define TANKER zones for refuelling.
|
||||
-- TODO: Border zone or even multiple zones.
|
||||
-- TODO: Check that airbase has enough parking spots if a request is BIG. Alternatively, split requests.
|
||||
|
||||
@@ -373,17 +373,10 @@ end
|
||||
--- Remove asset from squadron.
|
||||
-- @param #AIRWING self
|
||||
-- @param #AIRWING.SquadronAsset Asset
|
||||
-- @return #AIRWING.Squadron Squadron table.
|
||||
function AIRWING:RemoveAssetFromSquadron(Asset)
|
||||
local squad=self:GetSquadronOfAsset(Asset)
|
||||
if squad then
|
||||
for i,_asset in pairs(squad.assets) do
|
||||
local asset=_asset --#AIRWING.SquadronAsset
|
||||
if asset.uid==Asset.uid then
|
||||
table.remove(squad.assets, i)
|
||||
return
|
||||
end
|
||||
end
|
||||
squad:DelAsset(Asset)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -578,7 +571,7 @@ function AIRWING:onafterStatus(From, Event, To)
|
||||
local mission=self:GetAssetCurrentMission(asset)
|
||||
local missiontext=""
|
||||
if mission then
|
||||
local distance=UTILS.MetersToNM(mission:GetTargetDistance(asset.flightgroup.group:GetCoordinate()))
|
||||
local distance=asset.flightgroup and UTILS.MetersToNM(mission:GetTargetDistance(asset.flightgroup.group:GetCoordinate())) or 0
|
||||
missiontext=string.format(" [%s (%s): status=%s, distance=%.1f NM]", mission.type, mission.name, mission.status, distance)
|
||||
end
|
||||
|
||||
@@ -586,6 +579,14 @@ function AIRWING:onafterStatus(From, Event, To)
|
||||
local payload=asset.payload and table.concat(asset.payload.missiontypes, ", ") or "None"
|
||||
text=text.." payload="..payload
|
||||
|
||||
text=text.." flight="
|
||||
if asset.flightgroup and asset.flightgroup:IsAlive() then
|
||||
local status=asset.flightgroup:GetState()
|
||||
local fuel=asset.flightgroup:IsFuelLow()
|
||||
else
|
||||
text=text.."N/A"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
self:I(self.lid..text)
|
||||
@@ -630,11 +631,10 @@ function AIRWING:_GetPatrolData(PatrolPoints)
|
||||
local Altitude=math.random(10,15)*1000
|
||||
local Speed=math.random(250, 350)
|
||||
|
||||
return self:NewPatrolPoint(Coordinate,Heading,LegLength,Altitude,Speed)
|
||||
return self:NewPatrolPoint(Coordinate, Heading, LegLength, Altitude, Speed)
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
--- Check how many CAP missions are assigned and add number of missing missions.
|
||||
@@ -703,6 +703,37 @@ function AIRWING:CheckAWACS()
|
||||
return self
|
||||
end
|
||||
|
||||
--- Check how many AWACS missions are assigned and add number of missing missions.
|
||||
-- @param #AIRWING self
|
||||
-- @param Ops.FlightGroup#FLIGHTGROUP flightgroup The flightgroup.
|
||||
-- @return #AIRWING.SquadronAsset The tanker asset.
|
||||
function AIRWING:GetTankerForFlight(flightgroup)
|
||||
|
||||
local tankers=self:GetAssetsOnMission(AUFTRAG.Type.TANKER)
|
||||
|
||||
if #tankers>0 then
|
||||
|
||||
local tankeropt={}
|
||||
for _,_tanker in pairs(tankers) do
|
||||
local tanker=_tanker --#AIRWING.SquadronAsset
|
||||
|
||||
local tankercoord=tanker.flightgroup.group:GetCoordinate()
|
||||
local assetcoord=Asset.flightgroup.group:GetCoordinate()
|
||||
|
||||
local dist=assetcoord:Get2DDistance(tankercoord)
|
||||
|
||||
table.insert(tankeropt, {tanker=tanker, dist=dist})
|
||||
end
|
||||
|
||||
table.sort(tankeropt, function(a,b) return a.dist<b.dist end)
|
||||
|
||||
return tankeropt[1]
|
||||
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
--- Get next mission.
|
||||
-- @param #AIRWING self
|
||||
@@ -992,6 +1023,9 @@ function AIRWING:onafterAssetSpawned(From, Event, To, group, asset, request)
|
||||
-- Set RTB on fuel critical.
|
||||
flightgroup:SetFuelCriticalThreshold(nil, true)
|
||||
|
||||
-- Set airwing.
|
||||
flightgroup:SetAirwing(self)
|
||||
|
||||
--flightgroup.group:OptionProhibitAfterburner(true)
|
||||
|
||||
-- Set asset flightgroup.
|
||||
@@ -1039,10 +1073,8 @@ function AIRWING:onafterAssetDead(From, Event, To, asset, request)
|
||||
self.wingcommander.detectionset:RemoveGroupsByName({asset.spawngroupname})
|
||||
end
|
||||
|
||||
--TODO: remove asset from mission.
|
||||
--local mission=self:GetAssetCurrentMission(asset)
|
||||
|
||||
--TODO: remove asset from squadron.
|
||||
-- Remove asset from mission is done via Mission:AssetDead() call from flightgroup onafterFlightDead function
|
||||
-- Remove asset from squadron same
|
||||
end
|
||||
|
||||
|
||||
@@ -1131,19 +1163,13 @@ function AIRWING:_CreateFlightGroup(asset)
|
||||
--- Mission started.
|
||||
function flightgroup:OnAfterMissionStart(From, Event, To, Mission)
|
||||
local airwing=flightgroup:GetAirWing()
|
||||
|
||||
-- TODO: Add event? Set mission status!
|
||||
--airwing:MissionStart(Mission)
|
||||
|
||||
end
|
||||
|
||||
--- Flight is DEAD.
|
||||
function flightgroup:OnAfterFlightDead(From, Event, To)
|
||||
local airwing=flightgroup:GetAirWing()
|
||||
|
||||
-- TODO
|
||||
-- Mission failed ==> launch new mission?
|
||||
|
||||
|
||||
end
|
||||
|
||||
return flightgroup
|
||||
@@ -1168,7 +1194,7 @@ function AIRWING:IsAssetOnMission(asset, MissionTypes)
|
||||
MissionTypes=AUFTRAG.Type
|
||||
end
|
||||
|
||||
if asset.flightgroup then
|
||||
if asset.flightgroup and asset.flightgroup:IsAlive() then
|
||||
|
||||
-- Loop over mission queue.
|
||||
for _,_mission in pairs(asset.flightgroup.missionqueue or {}) do
|
||||
@@ -1277,6 +1303,34 @@ function AIRWING:CountAssetsOnMission(MissionTypes)
|
||||
return Np+Nq, Np, Nq
|
||||
end
|
||||
|
||||
--- Count assets on mission.
|
||||
-- @param #AIRWING self
|
||||
-- @param #table MissionTypes Types on mission to be checked. Default all.
|
||||
-- @return #table Assets on pending requests.
|
||||
function AIRWING:GetAssetsOnMission(MissionTypes)
|
||||
|
||||
local assets={}
|
||||
local Np=0
|
||||
|
||||
for _,_mission in pairs(self.missionqueue) do
|
||||
local mission=_mission --Ops.Auftrag#AUFTRAG
|
||||
|
||||
-- Check if this mission type is requested.
|
||||
if self:CheckMissionType(mission.type, MissionTypes) then
|
||||
|
||||
for _,_asset in pairs(mission.assets or {}) do
|
||||
local asset=_asset --#AIRWING.SquadronAsset
|
||||
|
||||
table.insert(assets, asset)
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return assets
|
||||
end
|
||||
|
||||
|
||||
--- Check if assets for a given mission type are available.
|
||||
-- @param #AIRWING self
|
||||
-- @param Ops.Auftrag#AUFTRAG Mission The mission.
|
||||
|
||||
@@ -316,7 +316,7 @@ end
|
||||
function AUFTRAG:NewANTISHIP(TargetUnitSet)
|
||||
|
||||
if TargetUnitSet:IsInstanceOf("UNIT") then
|
||||
TargetUnitSet=SET_UNIT:New():AddGroup(TargetUnitSet)
|
||||
TargetUnitSet=SET_UNIT:New():AddUnit(TargetUnitSet)
|
||||
end
|
||||
|
||||
local mission=AUFTRAG:New(AUFTRAG.Type.ANTISHIP)
|
||||
@@ -986,6 +986,16 @@ function AUFTRAG:Evaluate()
|
||||
return self
|
||||
end
|
||||
|
||||
--- Get flight data table.
|
||||
-- @param #AUFTRAG self
|
||||
-- @param Ops.FlightGroup#FLIGHTGROUP flightgroup The flight group.
|
||||
-- @return #AUFTRAG.FlightData Flight data or nil if flightgroup does not exist.
|
||||
function AUFTRAG:GetFlightData(flightgroup)
|
||||
if flightgroup and self.flightdata then
|
||||
return self.flightdata[flightgroup.groupname]
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Set flightgroup mission status.
|
||||
-- @param #AUFTRAG self
|
||||
@@ -996,7 +1006,13 @@ function AUFTRAG:SetFlightStatus(flightgroup, status)
|
||||
if self:GetFlightStatus(flightgroup)==AUFTRAG.FlightStatus.CANCELLED and status==AUFTRAG.FlightStatus.DONE then
|
||||
-- Do not overwrite a CANCELLED status with a DONE status.
|
||||
else
|
||||
self.flightdata[flightgroup.groupname].status=status
|
||||
local flightdata=self:GetFlightData(flightgroup)
|
||||
if flightdata then
|
||||
flightdata.status=status
|
||||
else
|
||||
self:E(self.lid.."WARNING: Could not SET flight data for flight group. Setting status to DONE.")
|
||||
flightdata.status=AUFTRAG.FlightStatus.DONE
|
||||
end
|
||||
end
|
||||
|
||||
self:I(self.lid..string.format("Setting flight %s status to %s. IsNotOver=%s CheckFlightsDone=%s", flightgroup.groupname, self:GetFlightStatus(flightgroup), tostring(self:IsNotOver()), tostring(self:CheckFlightsDone())))
|
||||
@@ -1015,9 +1031,11 @@ end
|
||||
-- @param #AUFTRAG self
|
||||
-- @param Ops.FlightGroup#FLIGHTGROUP flightgroup The flight group.
|
||||
function AUFTRAG:GetFlightStatus(flightgroup)
|
||||
if flightgroup then
|
||||
return self.flightdata[flightgroup.groupname].status
|
||||
local flightdata=self:GetFlightData(flightgroup)
|
||||
if flightdata then
|
||||
return flightdata.status
|
||||
else
|
||||
self:E(self.lid.."WARNING: Could not get flight data for flight group. Returning status DONE.")
|
||||
return AUFTRAG.FlightStatus.DONE
|
||||
end
|
||||
end
|
||||
@@ -1028,14 +1046,20 @@ end
|
||||
-- @param Ops.FlightGroup#FLIGHTGROUP flightgroup The flight group.
|
||||
-- @param Core.Point#COORDINATE coordinate Waypoint Coordinate.
|
||||
function AUFTRAG:SetFlightWaypointCoordinate(flightgroup, coordinate)
|
||||
self.flightdata[flightgroup.groupname].waypointcoordinate=coordinate
|
||||
local flightdata=self:GetFlightData(flightgroup)
|
||||
if flightdata then
|
||||
flightdata.waypointcoordinate=coordinate
|
||||
end
|
||||
end
|
||||
|
||||
--- Get flightgroup waypoint coordinate.
|
||||
-- @param #AUFTRAG self
|
||||
-- @return Core.Point#COORDINATE Waypoint Coordinate.
|
||||
function AUFTRAG:GetFlightWaypointCoordinate(flightgroup)
|
||||
return self.flightdata[flightgroup.groupname].waypointcoordinate
|
||||
local flightdata=self:GetFlightData(flightgroup)
|
||||
if flightdata then
|
||||
return flightdata.waypointcoordinate
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1045,7 +1069,10 @@ end
|
||||
-- @param Ops.FlightGroup#FLIGHTGROUP.Task task Waypoint task.
|
||||
function AUFTRAG:SetFlightWaypointTask(flightgroup, task)
|
||||
self:I(self.lid..string.format("Setting waypoint task %s", task and task.description or "WTF"))
|
||||
self.flightdata[flightgroup.groupname].waypointtask=task
|
||||
local flightdata=self:GetFlightData(flightgroup)
|
||||
if flightdata then
|
||||
flightdata.waypointtask=task
|
||||
end
|
||||
end
|
||||
|
||||
--- Get flightgroup waypoint task.
|
||||
@@ -1053,11 +1080,14 @@ end
|
||||
-- @param Ops.FlightGroup#FLIGHTGROUP flightgroup The flight group.
|
||||
-- @return Ops.FlightGroup#FLIGHTGROUP.Task task Waypoint task. Waypoint task.
|
||||
function AUFTRAG:GetFlightWaypointTask(flightgroup)
|
||||
return self.flightdata[flightgroup.groupname].waypointtask
|
||||
local flightdata=self:GetFlightData(flightgroup)
|
||||
if flightdata then
|
||||
return flightdata.waypointtask
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- Get flightgroup mission status.
|
||||
--- Check if all flights are done with their mission (or dead).
|
||||
-- @param #AUFTRAG self
|
||||
-- @return #boolean If true, all flights are done with the mission.
|
||||
function AUFTRAG:CheckFlightsDone()
|
||||
@@ -1071,11 +1101,13 @@ function AUFTRAG:CheckFlightsDone()
|
||||
-- Check status of all flight groups.
|
||||
for groupname,data in pairs(self.flightdata) do
|
||||
local flightdata=data --#AUFTRAG.FlightData
|
||||
if flightdata.status==AUFTRAG.FlightStatus.DONE or flightdata.status==AUFTRAG.FlightStatus.CANCELLED then
|
||||
-- This one is done or cancelled.
|
||||
else
|
||||
-- At least this flight is not DONE or CANCELLED.
|
||||
return false
|
||||
if flightdata then
|
||||
if flightdata.status==AUFTRAG.FlightStatus.DONE or flightdata.status==AUFTRAG.FlightStatus.CANCELLED then
|
||||
-- This one is done or cancelled.
|
||||
else
|
||||
-- At least this flight is not DONE or CANCELLED.
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1245,9 +1277,7 @@ end
|
||||
-- @param #string To To state.
|
||||
function AUFTRAG:onafterCancel(From, Event, To)
|
||||
|
||||
--self.status=AUFTRAG.Status.CANCELLED
|
||||
--self:I(self.lid..string.format("New mission status=%s", self.status))
|
||||
|
||||
-- Debug info.
|
||||
self:I(self.lid..string.format("CANCELLING mission in status %s. Will wait for flights to report mission DONE before evaluation.", self.status))
|
||||
|
||||
if self.airwing then
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
-- @field #number fuelcriticalthresh Critical fuel threshold in percent.
|
||||
-- @field #boolean fuelcriticalrtb RTB on critical fuel switch.
|
||||
-- @field #boolean passedfinalwp Group has passed the final waypoint.
|
||||
-- @field Ops.Airwing#AIRWING airwing The airwing the flight group belongs to.
|
||||
-- @field Ops.AirWing#AIRWING airwing The airwing the flight group belongs to.
|
||||
-- @field Ops.FlightControl#FLIGHTCONTROL flightcontrol The flightcontrol handling this group.
|
||||
-- @field Core.UserFlag#USERFLAG flaghold Flag for holding.
|
||||
-- @field #number Tholding Abs. mission time stamp when the group reached the holding point.
|
||||
@@ -349,7 +349,7 @@ FLIGHTGROUP.ROT={
|
||||
|
||||
--- FLIGHTGROUP class version.
|
||||
-- @field #string version
|
||||
FLIGHTGROUP.version="0.3.5"
|
||||
FLIGHTGROUP.version="0.3.6"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@@ -1161,7 +1161,28 @@ function FLIGHTGROUP:Route(waypoints)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Route group along waypoints. Enroute tasks are also applied.
|
||||
-- @param #FLIGHTGROUP self
|
||||
-- @return #number Fuel in percent.
|
||||
function FLIGHTGROUP:GetFuelMin()
|
||||
|
||||
local fuelmin=math.huge
|
||||
for i,_element in pairs(self.elements) do
|
||||
local element=_element --#FLIGHTGROUP.Element
|
||||
|
||||
local unit=element.unit
|
||||
|
||||
if unit and unit:IsAlive() then
|
||||
local fuel=unit:GetFuel()
|
||||
if fuel<fuelmin then
|
||||
fuelmin=fuel
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return fuelmin*100
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- Start & Status
|
||||
@@ -1324,7 +1345,6 @@ function FLIGHTGROUP:onafterFlightStatus(From, Event, To)
|
||||
|
||||
-- Element status.
|
||||
text="Elements:"
|
||||
local fuelmin=math.huge
|
||||
for i,_element in pairs(self.elements) do
|
||||
local element=_element --#FLIGHTGROUP.Element
|
||||
|
||||
@@ -1334,11 +1354,6 @@ function FLIGHTGROUP:onafterFlightStatus(From, Event, To)
|
||||
local fuel=unit:GetFuel() or 0
|
||||
local life=unit:GetLifeRelative() or 0
|
||||
local parking=element.parking and tostring(element.parking.TerminalID) or "X"
|
||||
|
||||
-- Used later for low fuel thresh.
|
||||
if fuel*100<fuelmin then
|
||||
fuelmin=fuel*100
|
||||
end
|
||||
|
||||
-- Check if element is not dead and we missed an event.
|
||||
if life<0 and element.status~=FLIGHTGROUP.ElementStatus.DEAD and element.status~=FLIGHTGROUP.ElementStatus.INUTERO then
|
||||
@@ -1418,6 +1433,8 @@ function FLIGHTGROUP:onafterFlightStatus(From, Event, To)
|
||||
-- Fuel State
|
||||
---
|
||||
|
||||
local fuelmin=self:GetFuelMin()
|
||||
|
||||
-- Low fuel?
|
||||
if fuelmin<self.fuellowthresh and not self.fuellow then
|
||||
self:FuelLow()
|
||||
@@ -2760,7 +2777,8 @@ end
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
-- @param #string To To state.
|
||||
function FLIGHTGROUP:onafterRefuel(From, Event, To)
|
||||
-- @param Core.Point#COORDINATE Coordinate The coordinate.
|
||||
function FLIGHTGROUP:onafterRefuel(From, Event, To, Coordinate)
|
||||
|
||||
-- Debug message.
|
||||
local text=string.format("Flight group set to refuel at the nearest tanker")
|
||||
@@ -2771,15 +2789,22 @@ function FLIGHTGROUP:onafterRefuel(From, Event, To)
|
||||
|
||||
--TODO: cancel current task
|
||||
|
||||
|
||||
-- Orbit task.
|
||||
local TaskRefuel=self.group:TaskRefueling()
|
||||
local TaskFunction=self.group:TaskFunction("FLIGHTGROUP._FinishedRefuelling", self)
|
||||
local DCSTasks={TaskRefuel, TaskFunction}
|
||||
|
||||
local wp0=self.group:GetCoordinate():WaypointAir("BARO", COORDINATE.WaypointType.TurningPoint, COORINATE.WaypointAction.TurningPoint, Speed, true)
|
||||
local wp9=Coordinate:WaypointAir("BARO", COORDINATE.WaypointType.TurningPoint, COORINATE.WaypointAction.TurningPoint, Speed, true, nil, DCSTasks, "Refuel")
|
||||
|
||||
--local TaskCombo=self.group:TaskCombo({TaskFunction, TaskRefuel, TaskFunction})
|
||||
|
||||
local TaskCombo=self.group:TaskCombo({TaskFunction, TaskRefuel, TaskFunction})
|
||||
self:Route({wp0, wp9})
|
||||
|
||||
-- Set task.
|
||||
--self:SetTask(TaskCombo)
|
||||
self:PushTask(TaskCombo)
|
||||
--self:PushTask(TaskCombo)
|
||||
|
||||
end
|
||||
|
||||
@@ -2909,9 +2934,16 @@ function FLIGHTGROUP:onafterFuelLow(From, Event, To)
|
||||
-- Set switch to true.
|
||||
self.fuellow=true
|
||||
|
||||
-- Route helo back home. It is respawned! But this is the only way to ensure that it actually lands at the airbase.
|
||||
-- Back to destination or home.
|
||||
local airbase=self.destbase or self.homebase
|
||||
|
||||
if self.airwing then
|
||||
local tanker=self.airwing:GetTankerForFlight(self)
|
||||
|
||||
self:Refuel(tanker.flightgroup.group:GetCoordinate())
|
||||
|
||||
end
|
||||
|
||||
if airbase and self.fuellowrtb then
|
||||
self:RTB(airbase)
|
||||
--TODO: RTZ
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
-- @field Ops.AirWing#AIRWING airwing The AIRWING object the squadron belongs to.
|
||||
-- @field #number Ngroups Number of asset flight groups this squadron has.
|
||||
-- @field #number engageRange Engagement range in meters.
|
||||
-- @field #string attribute Generalized attribute of the squadron template group.
|
||||
-- @extends Core.Fsm#FSM
|
||||
|
||||
--- Be surprised!
|
||||
@@ -88,13 +89,20 @@ function SQUADRON:New(TemplateGroupName, Ngroups, SquadronName)
|
||||
|
||||
-- Name of the template group.
|
||||
self.templatename=TemplateGroupName
|
||||
|
||||
-- Squadron name.
|
||||
self.name=tostring(SquadronName or TemplateGroupName)
|
||||
|
||||
-- Set some string id for output to DCS.log file.
|
||||
self.lid=string.format("SQUADRON %s | ", self.name)
|
||||
|
||||
|
||||
-- Template group.
|
||||
self.templategroup=GROUP:FindByName(self.templatename)
|
||||
|
||||
-- Check if template group exists.
|
||||
if not self.templategroup then
|
||||
self:E("ERROR: Template group %s does not exist!", tostring(self.templatename))
|
||||
self:E(self.lid.."ERROR: Template group %s does not exist!", tostring(self.templatename))
|
||||
return nil
|
||||
end
|
||||
|
||||
@@ -104,11 +112,6 @@ function SQUADRON:New(TemplateGroupName, Ngroups, SquadronName)
|
||||
|
||||
self.attribute=self.templategroup:GetAttribute()
|
||||
|
||||
--self.flightgroup=AIGroup
|
||||
self.name=tostring(SquadronName or TemplateGroupName)
|
||||
|
||||
-- Set some string id for output to DCS.log file.
|
||||
self.lid=string.format("SQUADRON %s | ", self.name)
|
||||
|
||||
-- Start State.
|
||||
self:SetStartState("Stopped")
|
||||
@@ -178,7 +181,7 @@ end
|
||||
|
||||
--- Set skill.
|
||||
-- @param #SQUADRON self
|
||||
-- @param #string skill Skill of all flights.
|
||||
-- @param #string Skill Skill of all flights.
|
||||
-- @return #SQUADRON self
|
||||
function SQUADRON:SetSkill(Skill)
|
||||
self.skill=Skill
|
||||
|
||||
@@ -39,14 +39,6 @@ WINGCOMMANDER = {
|
||||
missionqueue = {},
|
||||
}
|
||||
|
||||
--- Mission resources.
|
||||
-- @type WINGCOMMANDER.Recourses
|
||||
--
|
||||
-- @field #string missiontype Mission Type.
|
||||
-- @field #number Ntot Total number of assets for this task.
|
||||
-- @field #number Navail Number of available assets
|
||||
-- @field #number Nonmission Number of assets currently on mission.
|
||||
|
||||
--- Contact details.
|
||||
-- @type WINGCOMMANDER.Contact
|
||||
-- @field Ops.Auftrag#AUFTRAG mission The assigned mission.
|
||||
|
||||
@@ -576,7 +576,7 @@ function AIRBASE:GetParkingSpotsNumber(termtype)
|
||||
local parkingdata=self:GetParkingData(false)
|
||||
|
||||
local nspots=0
|
||||
for _,parkingspot in pairs(parkingdata) do
|
||||
for _,parkingspot in pairs(self.parking) do
|
||||
if AIRBASE._CheckTerminalType(parkingspot.Term_Type, termtype) then
|
||||
nspots=nspots+1
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user