From f59326bf1065ef4ffce37dcff48f0d66c60d0b27 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sat, 24 Jun 2023 14:03:43 +0200 Subject: [PATCH] #ATIS * Fix for airbases which have no runways, e.g. Naqoura Syria --- Moose Development/Moose/Ops/ATIS.lua | 31 ++++++++++++++++++---------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/Moose Development/Moose/Ops/ATIS.lua b/Moose Development/Moose/Ops/ATIS.lua index 3780ba573..719ad8da7 100644 --- a/Moose Development/Moose/Ops/ATIS.lua +++ b/Moose Development/Moose/Ops/ATIS.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: cast-local-type --- **Ops** - Automatic Terminal Information Service (ATIS). -- -- === @@ -608,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 @@ -2139,16 +2141,20 @@ function ATIS:onafterBroadcast( From, Event, To ) end end alltext = alltext .. ";\n" .. subtitle + + local _RUNACT 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 - local _RUNACT = subtitle + _RUNACT = subtitle if not self.useSRS then self:Transmission(ATIS.Sound.ActiveRunway, 1.0, subtitle) self.radioqueue:Number2Transmission(runwayLanding) @@ -2509,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.