From c7a66e0f9964e5d0d1dc60a521ef821fea21c2e0 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 26 Jun 2023 17:29:02 +0200 Subject: [PATCH] #Fixes --- Moose Development/Moose/Ops/ATIS.lua | 26 +++++++++++++-------- Moose Development/Moose/Wrapper/Airbase.lua | 4 +++- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Moose Development/Moose/Ops/ATIS.lua b/Moose Development/Moose/Ops/ATIS.lua index 25b8dc81c..719ad8da7 100644 --- a/Moose Development/Moose/Ops/ATIS.lua +++ b/Moose Development/Moose/Ops/ATIS.lua @@ -609,15 +609,16 @@ _ATIS = {} --- ATIS class version. -- @field #string version -ATIS.version = "0.9.14" +ATIS.version = "0.9.15" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --- TODO: Add new Normandy airfields. --- TODO: Zulu time --> Zulu in output. -- TODO: Correct fog for elevation. +-- DONE: Zulu time --> Zulu in output. +-- DONE: Fix for AB not having a runway - Helopost like Naqoura +-- DONE: Add new Normandy airfields. -- DONE: Use new AIRBASE system to set start/landing runway -- DONE: SetILS doesn't work -- DONE: Visibility reported twice over SRS @@ -2145,11 +2146,13 @@ function ATIS:onafterBroadcast( From, Event, To ) if not self.ATISforFARPs then -- Active runway. - local subtitle=string.format("Active runway %s", runwayLanding) - if rwyLandingLeft==true then - subtitle=subtitle.." Left" - elseif rwyLandingLeft==false then - subtitle=subtitle.." Right" + if runwayLanding then + local subtitle=string.format("Active runway %s", runwayLanding) + if rwyLandingLeft==true then + subtitle=subtitle.." Left" + elseif rwyLandingLeft==false then + subtitle=subtitle.." Right" + end end _RUNACT = subtitle if not self.useSRS then @@ -2512,8 +2515,11 @@ function ATIS:GetActiveRunway(Takeoff) else runway=self.airbase:GetActiveRunwayLanding() end - - return runway.name, runway.isLeft + if runway then -- some ABs have NO runways, e.g. Syria Naqoura + return runway.name, runway.isLeft + else + return nil, nil + end end --- Get runway from user supplied magnetic heading. diff --git a/Moose Development/Moose/Wrapper/Airbase.lua b/Moose Development/Moose/Wrapper/Airbase.lua index 60c47d7e8..78d3d40d8 100644 --- a/Moose Development/Moose/Wrapper/Airbase.lua +++ b/Moose Development/Moose/Wrapper/Airbase.lua @@ -1504,7 +1504,9 @@ function AIRBASE:FindFreeParkingSpotForAircraft(group, terminaltype, scanradius, local _aircraftsize, ax,ay,az if group and group.ClassName == "GROUP" then aircraft=group:GetUnit(1) - _aircraftsize, ax,ay,az=aircraft:GetObjectSize() + if aircraft then + _aircraftsize, ax,ay,az=aircraft:GetObjectSize() + end else -- SU27 dimensions _aircraftsize = 23