From 093a60050b1476359f28f892fa62c361b13b45bd Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 13 Aug 2024 09:49:48 +0200 Subject: [PATCH] xx --- Moose Development/Moose/Core/Point.lua | 8 ++++---- Moose Development/Moose/Ops/ATIS.lua | 24 +++++++++++++++--------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua index c5272252e..3bf9c0dd1 100644 --- a/Moose Development/Moose/Core/Point.lua +++ b/Moose Development/Moose/Core/Point.lua @@ -2669,9 +2669,9 @@ do -- COORDINATE local date=UTILS.GetDCSMissionDate() -- Debug output. - --self:I(string.format("Sun rise at lat=%.3f long=%.3f on %s (DayOfYear=%d): %s (%d sec of the day) (GMT %d)", Latitude, Longitude, date, DayOfYear, tostring(UTILS.SecondsToClock(sunrise)), sunrise, Tdiff)) + self:I(string.format("Sun rise at lat=%.3f long=%.3f on %s (DayOfYear=%d): %s (%d sec of the day) (GMT %d)", Latitude, Longitude, date, DayOfYear, tostring(UTILS.SecondsToClock(sunrise)), sunrise, Tdiff)) - if InSeconds then + if InSeconds or type(sunrise) == "string" then return sunrise else return UTILS.SecondsToClock(sunrise, true) @@ -2837,9 +2837,9 @@ do -- COORDINATE local date=UTILS.GetDCSMissionDate() -- Debug output. - --self:I(string.format("Sun set at lat=%.3f long=%.3f on %s (DayOfYear=%d): %s (%d sec of the day) (GMT %d)", Latitude, Longitude, date, DayOfYear, tostring(UTILS.SecondsToClock(sunrise)), sunrise, Tdiff)) + self:I(string.format("Sun set at lat=%.3f long=%.3f on %s (DayOfYear=%d): %s (%d sec of the day) (GMT %d)", Latitude, Longitude, date, DayOfYear, tostring(UTILS.SecondsToClock(sunrise)), sunrise, Tdiff)) - if InSeconds then + if InSeconds or type(sunrise) == "string" then return sunrise else return UTILS.SecondsToClock(sunrise, true) diff --git a/Moose Development/Moose/Ops/ATIS.lua b/Moose Development/Moose/Ops/ATIS.lua index e835c8885..a5b577dde 100644 --- a/Moose Development/Moose/Ops/ATIS.lua +++ b/Moose Development/Moose/Ops/ATIS.lua @@ -1975,17 +1975,23 @@ function ATIS:onafterBroadcast( From, Event, To ) local hours = self.gettext:GetEntry("HOURS",self.locale) local sunrise = coord:GetSunrise() - sunrise = UTILS.Split( sunrise, ":" ) - local SUNRISE = string.format( "%s%s", sunrise[1], sunrise[2] ) - if self.useSRS then - SUNRISE = string.format( "%s %s %s", sunrise[1], sunrise[2], hours ) + local SUNRISE = "no time" + if tostring(sunrise) ~= "N/R" then + sunrise = UTILS.Split( sunrise, ":" ) + SUNRISE = string.format( "%s%s", sunrise[1], sunrise[2] ) + if self.useSRS then + SUNRISE = string.format( "%s %s %s", sunrise[1], sunrise[2], hours ) + end end - + local sunset = coord:GetSunset() - sunset = UTILS.Split( sunset, ":" ) - local SUNSET = string.format( "%s%s", sunset[1], sunset[2] ) - if self.useSRS then - SUNSET = string.format( "%s %s %s", sunset[1], sunset[2], hours ) + local SUNSET = "no time" + if tostring(sunset) ~= "N/S" then + sunset = UTILS.Split( sunset, ":" ) + SUNSET = string.format( "%s%s", sunset[1], sunset[2] ) + if self.useSRS then + SUNSET = string.format( "%s %s %s", sunset[1], sunset[2], hours ) + end end ---------------------------------