diff --git a/Moose Development/Moose/Ops/AirWing.lua b/Moose Development/Moose/Ops/AirWing.lua index 07d95be3f..d4f69ea8c 100644 --- a/Moose Development/Moose/Ops/AirWing.lua +++ b/Moose Development/Moose/Ops/AirWing.lua @@ -718,7 +718,7 @@ function AIRWING:GetTankerForFlight(flightgroup) local tanker=_tanker --#AIRWING.SquadronAsset local tankercoord=tanker.flightgroup.group:GetCoordinate() - local assetcoord=Asset.flightgroup.group:GetCoordinate() + local assetcoord=flightgroup.group:GetCoordinate() local dist=assetcoord:Get2DDistance(tankercoord) diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index 91b230f31..ce0b39420 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -394,6 +394,8 @@ function AUFTRAG:NewTANKER(OrbitCoordinate, OrbitSpeed, Heading, Leg, Altitude) -- Mission type PATROL. mission.type=AUFTRAG.Type.TANKER + mission.missionTask=ENUMS.MissionTask.REFUELING + mission.DCStask=mission:GetDCSMissionTask() return mission @@ -415,6 +417,8 @@ function AUFTRAG:NewAWACS(OrbitCoordinate, OrbitSpeed, Heading, Leg, Altitude) -- Mission type PATROL. mission.type=AUFTRAG.Type.AWACS + mission.missionTask=ENUMS.MissionTask.AWACS + mission.DCStask=mission:GetDCSMissionTask() return mission @@ -1719,9 +1723,9 @@ function AUFTRAG:GetDCSMissionTask() -- 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 @@ -1757,6 +1761,8 @@ function AUFTRAG:GetDCSMissionTask() -- Count mission targets. self.Ntargets=self:CountMissionTargets() + + self:I({missiontask=DCStasks}) -- Return the task. if #DCStasks==1 then diff --git a/Moose Development/Moose/Ops/FlightGroup.lua b/Moose Development/Moose/Ops/FlightGroup.lua index d4a512dfb..c8224e9f8 100644 --- a/Moose Development/Moose/Ops/FlightGroup.lua +++ b/Moose Development/Moose/Ops/FlightGroup.lua @@ -2794,6 +2794,8 @@ function FLIGHTGROUP:onafterRefuel(From, Event, To, Coordinate) local TaskRefuel=self.group:TaskRefueling() local TaskFunction=self.group:TaskFunction("FLIGHTGROUP._FinishedRefuelling", self) 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 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 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 - if airbase and self.fuellowrtb then - self:RTB(airbase) - --TODO: RTZ - end end --- On after "FuelCritical" event. diff --git a/Moose Development/Moose/Ops/Squadron.lua b/Moose Development/Moose/Ops/Squadron.lua index a489cdf25..bb0b26dd7 100644 --- a/Moose Development/Moose/Ops/Squadron.lua +++ b/Moose Development/Moose/Ops/Squadron.lua @@ -102,7 +102,7 @@ function SQUADRON:New(TemplateGroupName, Ngroups, SquadronName) -- Check if template group exists. 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 end diff --git a/Moose Development/Moose/Wrapper/Airbase.lua b/Moose Development/Moose/Wrapper/Airbase.lua index 1abd7bbce..76d4b71f0 100644 --- a/Moose Development/Moose/Wrapper/Airbase.lua +++ b/Moose Development/Moose/Wrapper/Airbase.lua @@ -576,7 +576,7 @@ function AIRBASE:GetParkingSpotsNumber(termtype) local parkingdata=self:GetParkingData(false) 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 nspots=nspots+1 end diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 7c140a1ea..b161553c0 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -1559,7 +1559,7 @@ function CONTROLLABLE:EnRouteTaskAWACS( ) local DCSTask = { id = 'AWACS', - params = {} + params = {}, } return DCSTask @@ -1573,7 +1573,7 @@ function CONTROLLABLE:EnRouteTaskTanker( ) local DCSTask = { id = 'Tanker', - params = {} + params = {}, } return DCSTask @@ -1589,7 +1589,7 @@ function CONTROLLABLE:EnRouteTaskEWR( ) local DCSTask = { id = 'EWR', - params = {} + params = {}, } return DCSTask