From 38863514907ca72333c2fdc89dd4447d0d3e2136 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 8 Jan 2026 13:10:37 +0100 Subject: [PATCH 1/5] xx --- Moose Development/Moose/Core/Point.lua | 15 ++++- Moose Development/Moose/Ops/PlayerTask.lua | 74 +++++++++++++++++++--- 2 files changed, 80 insertions(+), 9 deletions(-) diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua index 066c358ec..ee2b0c6ce 100644 --- a/Moose Development/Moose/Core/Point.lua +++ b/Moose Development/Moose/Core/Point.lua @@ -3281,7 +3281,6 @@ do -- COORDINATE return delta/60 end - --- Return a BR string from a COORDINATE to the COORDINATE. -- @param #COORDINATE self -- @param #COORDINATE FromCoordinate The coordinate to measure the distance and the bearing from. @@ -3295,6 +3294,20 @@ do -- COORDINATE local Distance = self:Get2DDistance( FromCoordinate ) return "BR, " .. self:GetBRText( AngleRadians, Distance, Settings, nil, MagVar, Precision ) end + + --- Return a Bearing string from a COORDINATE to the (self) COORDINATE. + -- @param #COORDINATE self + -- @param #COORDINATE FromCoordinate The coordinate to measure the distance and the bearing from. + -- @param Core.Settings#SETTINGS Settings (optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object. + -- @param #boolean MagVar If true, also get angle in MagVar for BR/BRA + -- @param #number Precision Rounding precision, currently full km as default (=0) + -- @return #string The BR text. + function COORDINATE:ToStringBearing( FromCoordinate, Settings, MagVar, Precision ) + local DirectionVec3 = FromCoordinate:GetDirectionVec3( self ) + local AngleRadians = self:GetAngleRadians( DirectionVec3 ) + --local Distance = self:Get2DDistance( FromCoordinate ) + return self:GetBearingText(AngleRadians,Precision,Settings,MagVar) + end --- Return a BRA string from a COORDINATE to the COORDINATE. -- @param #COORDINATE self diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index d52e7347a..a43909dfb 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -237,7 +237,7 @@ function PLAYERTASK:New(Type, Target, Repeat, Times, TTSType) -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. - -- @param #boolen Silent If true, suppress message output on cancel. + -- @param #boolean Silent If true, suppress message output on cancel. --- On After "Planned" event. Task has been planned. -- @function [parent=#PLAYERTASK] OnAfterPilotPlanned @@ -1599,6 +1599,7 @@ do -- ELEVATION = "\nTarget Elevation: %s %s", -- METER = "meter", -- FEET = "feet", +-- INTERCEPTCOURSE = "Intercept course", -- }, -- -- e.g. @@ -1921,6 +1922,7 @@ PLAYERTASKCONTROLLER.Messages = { DESTROYER = "Destroyer", CARRIER = "Aircraft Carrier", RADIOS = "Radios", + INTERCEPTCOURSE = "Intercept course", }, DE = { TASKABORT = "Auftrag abgebrochen!", @@ -2008,12 +2010,13 @@ PLAYERTASKCONTROLLER.Messages = { DESTROYER = "Zerstörer", CARRIER = "Flugzeugträger", RADIOS = "Frequenzen", + INTERCEPTCOURSE = "Abfangkurs", }, } --- PLAYERTASK class version. -- @field #string version -PLAYERTASKCONTROLLER.version="0.1.71" +PLAYERTASKCONTROLLER.version="0.1.73" --- Create and run a new TASKCONTROLLER instance. -- @param #PLAYERTASKCONTROLLER self @@ -3776,6 +3779,41 @@ function PLAYERTASKCONTROLLER:_ShowRadioInfo(Group, Client) return self end +--- Calculate group future position after given seconds. +-- @param #PLAYERTASKCONTROLLER self +-- @param Wrapper.Group#GROUP group The group to calculate for. +-- @param #number seconds Time interval in seconds. Default is `self.prediction`. +-- @return Core.Point#COORDINATE Calculated future position of the cluster. +function PLAYERTASKCONTROLLER:_CalcGroupFuturePosition(group, seconds) + + -- Get current position of the cluster. + local p=group:GetCoordinate() + + -- Velocity vector in m/s. + local v=group:GetVelocityVec3() + + -- Time in seconds. + local t=seconds or self.prediction + + -- Extrapolated vec3. + local Vec3={x=p.x+v.x*t, y=p.y+v.y*t, z=p.z+v.z*t} + + -- Future position. + local futureposition=COORDINATE:NewFromVec3(Vec3) + + -- Create an arrow pointing in the direction of the movement. + if self.verbose == true then + local markerID = group:GetProperty("PLAYERTASK_ARROW") + if markerID then + COORDINATE:RemoveMark(markerID) + end + markerID = p:ArrowToAll(futureposition, self.coalition, {1,0,0}, 1, {1,1,0}, 0.5, 2, true, "Position Calc") + group:SetProperty("PLAYERTASK_ARROW",markerID) + end + + return futureposition +end + --- [Internal] Flashing directional info for a client -- @param #PLAYERTASKCONTROLLER self -- @return #PLAYERTASKCONTROLLER self @@ -3785,16 +3823,34 @@ function PLAYERTASKCONTROLLER:_FlashInfo() if _client and _client:IsAlive() then if self.TasksPerPlayer:HasUniqueID(_playername) then local task = self.TasksPerPlayer:ReadByID(_playername) -- Ops.PlayerTask#PLAYERTASK - local Coordinate = task.Target:GetCoordinate() + local Coordinate = task.Target:GetCoordinate() -- Core.Point#COORDINATE local CoordText = "" if self.Type ~= PLAYERTASKCONTROLLER.Type.A2A and task.Type~=AUFTRAG.Type.INTERCEPT then CoordText = Coordinate:ToStringA2G(_client, nil, self.ShowMagnetic) + local targettxt = self.gettext:GetEntry("TARGET",self.locale) + local text = targettxt..": "..CoordText + local m = MESSAGE:New(text,10,"Tasking"):ToClient(_client) else CoordText = Coordinate:ToStringA2A(_client, nil, self.ShowMagnetic) + local targettxt = self.gettext:GetEntry("TARGET",self.locale) + local text = targettxt..": "..CoordText + -- calc intercept position + local name=task.Target:GetName() + local group = GROUP:FindByName(name) + local clientcoord = _client:GetCoordinate() + if group and clientcoord and group:IsAlive() and task.Type==AUFTRAG.Type.INTERCEPT then + local speed = math.max(UTILS.KnotsToMps(350) or _client:GetVelocityMPS()) + local dist = Coordinate:Get3DDistance(clientcoord) + local iTime = math.floor(dist/speed)+5 + if iTime < 10 then iTime = 10 + elseif iTime > 600 then iTime = 600 end + local npos = self:_CalcGroupFuturePosition(group,iTime) + local BR = npos:ToStringBearing(clientcoord,nil,self.ShowMagnetic,0 ) + local Intercepttext = self.gettext:GetEntry("INTERCEPTCOURSE",self.locale) + text = text .. "\n"..Intercepttext.." "..BR + end + local m = MESSAGE:New(text,10,"Tasking"):ToClient(_client) end - local targettxt = self.gettext:GetEntry("TARGET",self.locale) - local text = "Target: "..CoordText - local m = MESSAGE:New(text,10,"Tasking"):ToClient(_client) end end end @@ -3883,8 +3939,10 @@ function PLAYERTASKCONTROLLER:_ActiveTaskInfo(Task, Group, Client) Elevation = math.floor(UTILS.MetersToFeet(Elevation)) end -- ELEVATION = "\nTarget Elevation: %s %s", - local elev = self.gettext:GetEntry("ELEVATION",self.locale) - text = text .. string.format(elev,tostring(math.floor(Elevation)),elevationmeasure) + if task.Type ~= AUFTRAG.Type.INTERCEPT then + local elev = self.gettext:GetEntry("ELEVATION",self.locale) + text = text .. string.format(elev,tostring(math.floor(Elevation)),elevationmeasure) + end -- Prec bombing if task.Type == AUFTRAG.Type.PRECISIONBOMBING and self.precisionbombing then if LasingDrone and LasingDrone.playertask then From 7259038b1c07f24140f7346c8038aa3981d3a359 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 8 Jan 2026 13:10:48 +0100 Subject: [PATCH 2/5] xx --- Moose Development/Moose/Core/Point.lua | 15 ++++- Moose Development/Moose/Ops/PlayerTask.lua | 74 +++++++++++++++++++--- 2 files changed, 80 insertions(+), 9 deletions(-) diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua index 066c358ec..ee2b0c6ce 100644 --- a/Moose Development/Moose/Core/Point.lua +++ b/Moose Development/Moose/Core/Point.lua @@ -3281,7 +3281,6 @@ do -- COORDINATE return delta/60 end - --- Return a BR string from a COORDINATE to the COORDINATE. -- @param #COORDINATE self -- @param #COORDINATE FromCoordinate The coordinate to measure the distance and the bearing from. @@ -3295,6 +3294,20 @@ do -- COORDINATE local Distance = self:Get2DDistance( FromCoordinate ) return "BR, " .. self:GetBRText( AngleRadians, Distance, Settings, nil, MagVar, Precision ) end + + --- Return a Bearing string from a COORDINATE to the (self) COORDINATE. + -- @param #COORDINATE self + -- @param #COORDINATE FromCoordinate The coordinate to measure the distance and the bearing from. + -- @param Core.Settings#SETTINGS Settings (optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object. + -- @param #boolean MagVar If true, also get angle in MagVar for BR/BRA + -- @param #number Precision Rounding precision, currently full km as default (=0) + -- @return #string The BR text. + function COORDINATE:ToStringBearing( FromCoordinate, Settings, MagVar, Precision ) + local DirectionVec3 = FromCoordinate:GetDirectionVec3( self ) + local AngleRadians = self:GetAngleRadians( DirectionVec3 ) + --local Distance = self:Get2DDistance( FromCoordinate ) + return self:GetBearingText(AngleRadians,Precision,Settings,MagVar) + end --- Return a BRA string from a COORDINATE to the COORDINATE. -- @param #COORDINATE self diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index d52e7347a..a43909dfb 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -237,7 +237,7 @@ function PLAYERTASK:New(Type, Target, Repeat, Times, TTSType) -- @param #string From From state. -- @param #string Event Event. -- @param #string To To state. - -- @param #boolen Silent If true, suppress message output on cancel. + -- @param #boolean Silent If true, suppress message output on cancel. --- On After "Planned" event. Task has been planned. -- @function [parent=#PLAYERTASK] OnAfterPilotPlanned @@ -1599,6 +1599,7 @@ do -- ELEVATION = "\nTarget Elevation: %s %s", -- METER = "meter", -- FEET = "feet", +-- INTERCEPTCOURSE = "Intercept course", -- }, -- -- e.g. @@ -1921,6 +1922,7 @@ PLAYERTASKCONTROLLER.Messages = { DESTROYER = "Destroyer", CARRIER = "Aircraft Carrier", RADIOS = "Radios", + INTERCEPTCOURSE = "Intercept course", }, DE = { TASKABORT = "Auftrag abgebrochen!", @@ -2008,12 +2010,13 @@ PLAYERTASKCONTROLLER.Messages = { DESTROYER = "Zerstörer", CARRIER = "Flugzeugträger", RADIOS = "Frequenzen", + INTERCEPTCOURSE = "Abfangkurs", }, } --- PLAYERTASK class version. -- @field #string version -PLAYERTASKCONTROLLER.version="0.1.71" +PLAYERTASKCONTROLLER.version="0.1.73" --- Create and run a new TASKCONTROLLER instance. -- @param #PLAYERTASKCONTROLLER self @@ -3776,6 +3779,41 @@ function PLAYERTASKCONTROLLER:_ShowRadioInfo(Group, Client) return self end +--- Calculate group future position after given seconds. +-- @param #PLAYERTASKCONTROLLER self +-- @param Wrapper.Group#GROUP group The group to calculate for. +-- @param #number seconds Time interval in seconds. Default is `self.prediction`. +-- @return Core.Point#COORDINATE Calculated future position of the cluster. +function PLAYERTASKCONTROLLER:_CalcGroupFuturePosition(group, seconds) + + -- Get current position of the cluster. + local p=group:GetCoordinate() + + -- Velocity vector in m/s. + local v=group:GetVelocityVec3() + + -- Time in seconds. + local t=seconds or self.prediction + + -- Extrapolated vec3. + local Vec3={x=p.x+v.x*t, y=p.y+v.y*t, z=p.z+v.z*t} + + -- Future position. + local futureposition=COORDINATE:NewFromVec3(Vec3) + + -- Create an arrow pointing in the direction of the movement. + if self.verbose == true then + local markerID = group:GetProperty("PLAYERTASK_ARROW") + if markerID then + COORDINATE:RemoveMark(markerID) + end + markerID = p:ArrowToAll(futureposition, self.coalition, {1,0,0}, 1, {1,1,0}, 0.5, 2, true, "Position Calc") + group:SetProperty("PLAYERTASK_ARROW",markerID) + end + + return futureposition +end + --- [Internal] Flashing directional info for a client -- @param #PLAYERTASKCONTROLLER self -- @return #PLAYERTASKCONTROLLER self @@ -3785,16 +3823,34 @@ function PLAYERTASKCONTROLLER:_FlashInfo() if _client and _client:IsAlive() then if self.TasksPerPlayer:HasUniqueID(_playername) then local task = self.TasksPerPlayer:ReadByID(_playername) -- Ops.PlayerTask#PLAYERTASK - local Coordinate = task.Target:GetCoordinate() + local Coordinate = task.Target:GetCoordinate() -- Core.Point#COORDINATE local CoordText = "" if self.Type ~= PLAYERTASKCONTROLLER.Type.A2A and task.Type~=AUFTRAG.Type.INTERCEPT then CoordText = Coordinate:ToStringA2G(_client, nil, self.ShowMagnetic) + local targettxt = self.gettext:GetEntry("TARGET",self.locale) + local text = targettxt..": "..CoordText + local m = MESSAGE:New(text,10,"Tasking"):ToClient(_client) else CoordText = Coordinate:ToStringA2A(_client, nil, self.ShowMagnetic) + local targettxt = self.gettext:GetEntry("TARGET",self.locale) + local text = targettxt..": "..CoordText + -- calc intercept position + local name=task.Target:GetName() + local group = GROUP:FindByName(name) + local clientcoord = _client:GetCoordinate() + if group and clientcoord and group:IsAlive() and task.Type==AUFTRAG.Type.INTERCEPT then + local speed = math.max(UTILS.KnotsToMps(350) or _client:GetVelocityMPS()) + local dist = Coordinate:Get3DDistance(clientcoord) + local iTime = math.floor(dist/speed)+5 + if iTime < 10 then iTime = 10 + elseif iTime > 600 then iTime = 600 end + local npos = self:_CalcGroupFuturePosition(group,iTime) + local BR = npos:ToStringBearing(clientcoord,nil,self.ShowMagnetic,0 ) + local Intercepttext = self.gettext:GetEntry("INTERCEPTCOURSE",self.locale) + text = text .. "\n"..Intercepttext.." "..BR + end + local m = MESSAGE:New(text,10,"Tasking"):ToClient(_client) end - local targettxt = self.gettext:GetEntry("TARGET",self.locale) - local text = "Target: "..CoordText - local m = MESSAGE:New(text,10,"Tasking"):ToClient(_client) end end end @@ -3883,8 +3939,10 @@ function PLAYERTASKCONTROLLER:_ActiveTaskInfo(Task, Group, Client) Elevation = math.floor(UTILS.MetersToFeet(Elevation)) end -- ELEVATION = "\nTarget Elevation: %s %s", - local elev = self.gettext:GetEntry("ELEVATION",self.locale) - text = text .. string.format(elev,tostring(math.floor(Elevation)),elevationmeasure) + if task.Type ~= AUFTRAG.Type.INTERCEPT then + local elev = self.gettext:GetEntry("ELEVATION",self.locale) + text = text .. string.format(elev,tostring(math.floor(Elevation)),elevationmeasure) + end -- Prec bombing if task.Type == AUFTRAG.Type.PRECISIONBOMBING and self.precisionbombing then if LasingDrone and LasingDrone.playertask then From 2fdbdb40581b69f90afef0a7cc44292a70b0d708 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 8 Jan 2026 18:51:09 +0100 Subject: [PATCH 3/5] #RECOVERYTANKER - Ensure correct "F10 Name" for A6E if used as tanker --- .../Moose/Ops/RecoveryTanker.lua | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Ops/RecoveryTanker.lua b/Moose Development/Moose/Ops/RecoveryTanker.lua index 02e0828a7..59c38e9b2 100644 --- a/Moose Development/Moose/Ops/RecoveryTanker.lua +++ b/Moose Development/Moose/Ops/RecoveryTanker.lua @@ -310,7 +310,7 @@ _RECOVERYTANKERID=0 --- Class version. -- @field #string version -RECOVERYTANKER.version="1.0.10" +RECOVERYTANKER.version="1.0.11" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -923,6 +923,22 @@ function RECOVERYTANKER:onafterStart(From, Event, To) Spawn:InitRadioCommsOnOff(true) Spawn:InitRadioFrequency(self.RadioFreq) Spawn:InitRadioModulation(self.RadioModu) + + if self.callsignname and self.callsignnumber then + local grp = GROUP:FindByName(self.tankergroupname) + if grp then + local typename = grp:GetTypeName() or "" + --self:I(self.lid.."Typename: "..typename) + local Name + local enumerator = CALLSIGN.Tanker + if typename == "A6E" then + enumerator = CALLSIGN.Intruder + end + Name = self:_GetCallsignName(self.callsignname,enumerator) + --self:I(self.lid.."CallsignName: "..Name) + Spawn:InitCallSign(self.callsignname,Name,self.callsignnumber,self.callsignnumber) + end + end Spawn:InitModex(self.modex) -- Spawn on carrier. @@ -1190,9 +1206,9 @@ function RECOVERYTANKER:onafterPatternUpdate(From, Event, To) -- Task combo. -- Be a tanker or be an AWACS. - local taskroll = self.tanker:EnRouteTaskTanker() + local taskrole = self.tanker:EnRouteTaskTanker() if self.awacs then - taskroll=self.tanker:EnRouteTaskAWACS() + taskrole=self.tanker:EnRouteTaskAWACS() end --local taskeplrs=self.tanker:TaskEPLRS(true, 2) @@ -1201,7 +1217,7 @@ function RECOVERYTANKER:onafterPatternUpdate(From, Event, To) local taskroute = self.tanker:TaskRoute(wp) -- Note that the order is important here! tasktanker has to come first. Otherwise it does not work. - local taskcombo = self.tanker:TaskCombo({taskroll, taskroute}) + local taskcombo = self.tanker:TaskCombo({taskrole, taskroute}) -- Set task. self.tanker:SetTask(taskcombo, 1) @@ -1450,6 +1466,20 @@ function RECOVERYTANKER:_RefuelingStop(EventData) end +--- Get clear name callsign for spawn from enumerator +-- @param #RECOVERYTANKER self +-- @param #number Callsign +-- @param #table Enumerator The table of callsigns, e.g. `CALLSIGN.Tanker` +-- @return #string Name Name or "" if not found +function RECOVERYTANKER:_GetCallsignName(Callsign, Enumerator) + for name, value in pairs(Enumerator or {}) do + if value==Callsign then + return name + end + end + return "" +end + --- A unit crashed or died. -- @param #RECOVERYTANKER self -- @param Core.Event#EVENTDATA EventData Event data. From 99b7b4b057c397d54ba1658518ec470b88f954ad Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 9 Jan 2026 15:38:05 +0100 Subject: [PATCH 4/5] #EASYGCICAP - Fix error in setting floor/ceiling for corridors --- Moose Development/Moose/Ops/EasyGCICAP.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/EasyGCICAP.lua b/Moose Development/Moose/Ops/EasyGCICAP.lua index 02a48aa1a..68804a66b 100644 --- a/Moose Development/Moose/Ops/EasyGCICAP.lua +++ b/Moose Development/Moose/Ops/EasyGCICAP.lua @@ -1626,7 +1626,7 @@ function EASYGCICAP:_StartIntel() if self.usecorridors == true then BlueIntel:SetCorridorZones(self.corridorzones) if self.corridorfloor or self.corridorceiling then - BlueIntel:SetCorridorLimitsFeet(self.corridorfloor,self.corridorceiling) + BlueIntel:SetCorridorLimits(self.corridorfloor,self.corridorceiling) end end From 9426905959bf305c616195eb5f8d09276e22879d Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 12 Jan 2026 08:48:37 +0100 Subject: [PATCH 5/5] #AIRBASE - Fix parking data table could be nil --- Moose Development/Moose/Wrapper/Airbase.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Airbase.lua b/Moose Development/Moose/Wrapper/Airbase.lua index 3dadbf940..fa1551363 100644 --- a/Moose Development/Moose/Wrapper/Airbase.lua +++ b/Moose Development/Moose/Wrapper/Airbase.lua @@ -2109,7 +2109,7 @@ end function AIRBASE:GetParkingSpotsNumber(termtype) -- Get free parking spots data. - local parkingdata=self:GetParkingData(false) + local parkingdata=self:GetParkingData(false) or {} local nspots=0 for _,parkingspot in pairs(parkingdata) do @@ -2129,7 +2129,7 @@ end function AIRBASE:GetFreeParkingSpotsNumber(termtype, allowTOAC) -- Get free parking spots data. - local parkingdata=self:GetParkingData(true) + local parkingdata=self:GetParkingData(true) or {} local nfree=0 for _,parkingspot in pairs(parkingdata) do @@ -2152,7 +2152,7 @@ end function AIRBASE:GetFreeParkingSpotsCoordinates(termtype, allowTOAC) -- Get free parking spots data. - local parkingdata=self:GetParkingData(true) + local parkingdata=self:GetParkingData(true) or {} -- Put coordinates of free spots into table. local spots={} @@ -2251,7 +2251,7 @@ end function AIRBASE:_InitParkingSpots() -- Get parking data of all spots (free or occupied) - local parkingdata=self:GetParkingData(false) + local parkingdata=self:GetParkingData(false) or {} -- Init table. self.parking={} @@ -2327,10 +2327,10 @@ end function AIRBASE:GetParkingSpotsTable(termtype) -- Get parking data of all spots (free or occupied) - local parkingdata=self:GetParkingData(false) + local parkingdata=self:GetParkingData(false) or {} -- Get parking data of all free spots. - local parkingfree=self:GetParkingData(true) + local parkingfree=self:GetParkingData(true) or {} -- Function to ckeck if any parking spot is free. local function _isfree(_tocheck) @@ -2379,7 +2379,7 @@ end function AIRBASE:GetFreeParkingSpotsTable(termtype, allowTOAC) -- Get parking data of all free spots. - local parkingfree=self:GetParkingData(true) + local parkingfree=self:GetParkingData(true) or {} -- Put coordinates of free spots into table. local freespots={} @@ -2409,7 +2409,7 @@ end function AIRBASE:GetParkingSpotData(TerminalID) -- Get parking data. - local parkingdata=self:GetParkingSpotsTable() + local parkingdata=self:GetParkingSpotsTable() or {} for _,_spot in pairs(parkingdata) do local spot=_spot --#AIRBASE.ParkingSpot @@ -2435,7 +2435,7 @@ function AIRBASE:MarkParkingSpots(termtype, mark) end -- Get parking data from getParking() wrapper function. - local parkingdata=self:GetParkingSpotsTable(termtype) + local parkingdata=self:GetParkingSpotsTable(termtype) or {} -- Get airbase name. local airbasename=self:GetName() @@ -2550,7 +2550,7 @@ function AIRBASE:FindFreeParkingSpotForAircraft(group, terminaltype, scanradius, local markobstacles=false -- Loop over all known parking spots - for _,parkingspot in pairs(parkingdata) do + for _,parkingspot in pairs(parkingdata or {}) do -- Coordinate of the parking spot. local _spot=parkingspot.Coordinate -- Core.Point#COORDINATE