From 3f501d5eb02cebba2871ea676c8ebbeb44e2e5f8 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Sat, 24 Jul 2021 23:21:01 +0200 Subject: [PATCH] Fix weather times for the umpteenth time --- Gui/Cache/Weather.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gui/Cache/Weather.cs b/Gui/Cache/Weather.cs index 5679fad2..8d7fda76 100644 --- a/Gui/Cache/Weather.cs +++ b/Gui/Cache/Weather.cs @@ -27,23 +27,23 @@ internal struct Weather public Weather(WeatherManager weather) { _weather = weather; - WeatherTimes = weather.NextWeatherChangeTimes(NumWeathers, -WeatherManager.SecondsPerWeather); + WeatherTimes = weather.NextWeatherChangeTimes(NumWeathers, -2 * WeatherManager.SecondsPerWeather); WeatherTimeStrings = new string[NumWeathers]; - _totalHour = 0; + _totalHour = EorzeaTime.CurrentHour() - 8; Filter = ""; FilterLower = ""; Weathers = CachedWeather.CreateWeatherCache(); FilterSize = Weathers.Max(c => ImGui.CalcTextSize(c.Zone).X); + Update(EorzeaTime.CurrentHour()); } public void Update(long totalHour) { - //if (totalHour - _totalHour < 8) - // return; + if (totalHour - _totalHour < 8) + return; UpdateWeather(); - if (_totalHour > 0) - UpdateTimes((totalHour - _totalHour) / 8); + UpdateTimes((totalHour - _totalHour) / 8); _totalHour = totalHour - ((totalHour % RealTime.HoursPerDay) & 0b111); }