mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-21 02:31:39 +00:00
Ops
This commit is contained in:
@@ -718,7 +718,7 @@ function AIRWING:GetTankerForFlight(flightgroup)
|
|||||||
local tanker=_tanker --#AIRWING.SquadronAsset
|
local tanker=_tanker --#AIRWING.SquadronAsset
|
||||||
|
|
||||||
local tankercoord=tanker.flightgroup.group:GetCoordinate()
|
local tankercoord=tanker.flightgroup.group:GetCoordinate()
|
||||||
local assetcoord=Asset.flightgroup.group:GetCoordinate()
|
local assetcoord=flightgroup.group:GetCoordinate()
|
||||||
|
|
||||||
local dist=assetcoord:Get2DDistance(tankercoord)
|
local dist=assetcoord:Get2DDistance(tankercoord)
|
||||||
|
|
||||||
|
|||||||
@@ -394,6 +394,8 @@ function AUFTRAG:NewTANKER(OrbitCoordinate, OrbitSpeed, Heading, Leg, Altitude)
|
|||||||
-- Mission type PATROL.
|
-- Mission type PATROL.
|
||||||
mission.type=AUFTRAG.Type.TANKER
|
mission.type=AUFTRAG.Type.TANKER
|
||||||
|
|
||||||
|
mission.missionTask=ENUMS.MissionTask.REFUELING
|
||||||
|
|
||||||
mission.DCStask=mission:GetDCSMissionTask()
|
mission.DCStask=mission:GetDCSMissionTask()
|
||||||
|
|
||||||
return mission
|
return mission
|
||||||
@@ -415,6 +417,8 @@ function AUFTRAG:NewAWACS(OrbitCoordinate, OrbitSpeed, Heading, Leg, Altitude)
|
|||||||
-- Mission type PATROL.
|
-- Mission type PATROL.
|
||||||
mission.type=AUFTRAG.Type.AWACS
|
mission.type=AUFTRAG.Type.AWACS
|
||||||
|
|
||||||
|
mission.missionTask=ENUMS.MissionTask.AWACS
|
||||||
|
|
||||||
mission.DCStask=mission:GetDCSMissionTask()
|
mission.DCStask=mission:GetDCSMissionTask()
|
||||||
|
|
||||||
return mission
|
return mission
|
||||||
@@ -1719,9 +1723,9 @@ function AUFTRAG:GetDCSMissionTask()
|
|||||||
-- TANKER Mission --
|
-- TANKER Mission --
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
local DCStask=CONTROLLABLE.EnRouteTaskTanker(nil)
|
--local DCStask=CONTROLLABLE.EnRouteTaskTanker(nil)
|
||||||
|
|
||||||
table.insert(DCStasks, DCStask)
|
--table.insert(DCStasks, DCStask)
|
||||||
|
|
||||||
elseif self.type==AUFTRAG.Type.TRANSPORT then
|
elseif self.type==AUFTRAG.Type.TRANSPORT then
|
||||||
|
|
||||||
@@ -1758,6 +1762,8 @@ function AUFTRAG:GetDCSMissionTask()
|
|||||||
-- Count mission targets.
|
-- Count mission targets.
|
||||||
self.Ntargets=self:CountMissionTargets()
|
self.Ntargets=self:CountMissionTargets()
|
||||||
|
|
||||||
|
self:I({missiontask=DCStasks})
|
||||||
|
|
||||||
-- Return the task.
|
-- Return the task.
|
||||||
if #DCStasks==1 then
|
if #DCStasks==1 then
|
||||||
return DCStasks[1]
|
return DCStasks[1]
|
||||||
|
|||||||
@@ -2795,6 +2795,8 @@ function FLIGHTGROUP:onafterRefuel(From, Event, To, Coordinate)
|
|||||||
local TaskFunction=self.group:TaskFunction("FLIGHTGROUP._FinishedRefuelling", self)
|
local TaskFunction=self.group:TaskFunction("FLIGHTGROUP._FinishedRefuelling", self)
|
||||||
local DCSTasks={TaskRefuel, TaskFunction}
|
local DCSTasks={TaskRefuel, TaskFunction}
|
||||||
|
|
||||||
|
local Speed=UTILS.KnotsToKmph(500)
|
||||||
|
|
||||||
local wp0=self.group:GetCoordinate():WaypointAir("BARO", COORDINATE.WaypointType.TurningPoint, COORINATE.WaypointAction.TurningPoint, Speed, true)
|
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 wp9=Coordinate:WaypointAir("BARO", COORDINATE.WaypointType.TurningPoint, COORINATE.WaypointAction.TurningPoint, Speed, true, nil, DCSTasks, "Refuel")
|
||||||
|
|
||||||
@@ -2940,14 +2942,25 @@ function FLIGHTGROUP:onafterFuelLow(From, Event, To)
|
|||||||
if self.airwing then
|
if self.airwing then
|
||||||
local tanker=self.airwing:GetTankerForFlight(self)
|
local tanker=self.airwing:GetTankerForFlight(self)
|
||||||
|
|
||||||
self:Refuel(tanker.flightgroup.group:GetCoordinate())
|
if tanker then
|
||||||
|
self:Refuel(tanker.flightgroup.group:GetCoordinate())
|
||||||
|
|
||||||
|
else
|
||||||
|
if airbase and self.fuellowrtb then
|
||||||
|
self:RTB(airbase)
|
||||||
|
--TODO: RTZ
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
if airbase and self.fuellowrtb then
|
||||||
|
self:RTB(airbase)
|
||||||
|
--TODO: RTZ
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if airbase and self.fuellowrtb then
|
|
||||||
self:RTB(airbase)
|
|
||||||
--TODO: RTZ
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- On after "FuelCritical" event.
|
--- On after "FuelCritical" event.
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ function SQUADRON:New(TemplateGroupName, Ngroups, SquadronName)
|
|||||||
|
|
||||||
-- Check if template group exists.
|
-- Check if template group exists.
|
||||||
if not self.templategroup then
|
if not self.templategroup then
|
||||||
self:E(self.lid.."ERROR: Template group %s does not exist!", tostring(self.templatename))
|
self:E(self.lid..string.format("ERROR: Template group %s does not exist!", tostring(self.templatename)))
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -576,7 +576,7 @@ function AIRBASE:GetParkingSpotsNumber(termtype)
|
|||||||
local parkingdata=self:GetParkingData(false)
|
local parkingdata=self:GetParkingData(false)
|
||||||
|
|
||||||
local nspots=0
|
local nspots=0
|
||||||
for _,parkingspot in pairs(self.parking) do
|
for _,parkingspot in pairs(parkingdata) do --self.parking) do
|
||||||
if AIRBASE._CheckTerminalType(parkingspot.Term_Type, termtype) then
|
if AIRBASE._CheckTerminalType(parkingspot.Term_Type, termtype) then
|
||||||
nspots=nspots+1
|
nspots=nspots+1
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1559,7 +1559,7 @@ function CONTROLLABLE:EnRouteTaskAWACS( )
|
|||||||
|
|
||||||
local DCSTask = {
|
local DCSTask = {
|
||||||
id = 'AWACS',
|
id = 'AWACS',
|
||||||
params = {}
|
params = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
return DCSTask
|
return DCSTask
|
||||||
@@ -1573,7 +1573,7 @@ function CONTROLLABLE:EnRouteTaskTanker( )
|
|||||||
|
|
||||||
local DCSTask = {
|
local DCSTask = {
|
||||||
id = 'Tanker',
|
id = 'Tanker',
|
||||||
params = {}
|
params = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
return DCSTask
|
return DCSTask
|
||||||
@@ -1589,7 +1589,7 @@ function CONTROLLABLE:EnRouteTaskEWR( )
|
|||||||
|
|
||||||
local DCSTask = {
|
local DCSTask = {
|
||||||
id = 'EWR',
|
id = 'EWR',
|
||||||
params = {}
|
params = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
return DCSTask
|
return DCSTask
|
||||||
|
|||||||
Reference in New Issue
Block a user