From eb0acdff6b0aa79ded98c16faff2b8930ff26579 Mon Sep 17 00:00:00 2001 From: legoboyvdlp R Date: Sat, 14 Aug 2021 21:14:10 +0100 Subject: [PATCH] Bugfix: fix display of ATIS when the received code is invalid --- Nasal/MCDU/ATIS.nas | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Nasal/MCDU/ATIS.nas b/Nasal/MCDU/ATIS.nas index 520796cf..06672670 100644 --- a/Nasal/MCDU/ATIS.nas +++ b/Nasal/MCDU/ATIS.nas @@ -86,7 +86,14 @@ var atisPage = { var pageMinusOne = (me.page - 1); var numberExtraChar = pageMinusOne * 210; me.L1 = [substr(message, numberExtraChar, 30), atsu.ATISInstances[me.index].station ~ "/" ~ (atsu.ATISInstances[me.index].type == 0 ? "ARR" : "DEP"), "wht"]; - me.R1 = [" ",atsu.DictionaryString.fetchString1(atsu.ATISInstances[me.index].receivedCode).string2 ~ " " ~ atsu.ATISInstances[me.index].receivedTime ~ "Z", "wht"]; + + var code = atsu.DictionaryString.fetchString1(atsu.ATISInstances[me.index].receivedCode); + if (code != "") { + me.R1 = [" ",code.string2 ~ " " ~ atsu.ATISInstances[me.index].receivedTime ~ "Z", "wht"]; + } else { + me.R1 = [" ",atsu.ATISInstances[me.index].receivedCode ~ " " ~ atsu.ATISInstances[me.index].receivedTime ~ "Z", "wht"]; + } + if (size(message) > 30) { me.L2[1] = substr(message, numberExtraChar + 30, 30); }