From 0c6aae45c1daeb325bb4583855421df31f8b41ce Mon Sep 17 00:00:00 2001 From: Tim Morgan Date: Sat, 11 Jul 2020 13:07:20 -0700 Subject: [PATCH] Do not report visibilities > 10 NM or 9999 m --- Moose Development/Moose/Ops/ATIS.lua | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Moose Development/Moose/Ops/ATIS.lua b/Moose Development/Moose/Ops/ATIS.lua index 706695eb2..13104cec8 100644 --- a/Moose Development/Moose/Ops/ATIS.lua +++ b/Moose Development/Moose/Ops/ATIS.lua @@ -1387,13 +1387,24 @@ function ATIS:onafterBroadcast(From, Event, To) visibilitymin=dust end end + + local VISIBILITY="" - -- Visibility in NM. - local VISIBILITY=string.format("%d", UTILS.Round(UTILS.MetersToNM(visibilitymin))) - - -- Visibility in km. if self.metric then - VISIBILITY=string.format("%d", UTILS.Round(visibilitymin/1000)) + -- Visibility in km. + local reportedviz=UTILS.Round(visibilitymin/1000) + -- max reported visibility 9999 m + if reportedviz > 10 then + reportedviz=10 + end + VISIBILITY=string.format("%d", reportedviz) + else + -- max reported visibility 10 NM + local reportedviz=UTILS.Round(UTILS.MetersToNM(visibilitymin)) + if reportedviz > 10 then + reportedviz=10 + end + VISIBILITY=string.format("%d", reportedviz) end --------------