Fixed datetime being incorrect inside GetActiveWeatherSeason

This commit is contained in:
Chomp
2025-01-27 12:02:14 +00:00
parent b4eceba9e6
commit 9c77553bde
2 changed files with 9 additions and 6 deletions
@@ -6,17 +6,15 @@ using Core.Models.Enums;
using Core.Models.Spt.Config;
using Core.Models.Utils;
using Core.Servers;
using SptCommon.Extensions;
using Core.Models.Spt.Bots;
using Core.Utils;
using static System.Net.Mime.MediaTypeNames;
using System;
using SptCommon.Extensions;
namespace Core.Services;
[Injectable(InjectionType.Singleton)]
public class SeasonalEventService(
ISptLogger<SeasonalEventService> _logger,
TimeUtil _timeUtil,
DatabaseService _databaseService,
GiftService _giftService,
LocalisationService _localisationService,
@@ -288,7 +286,7 @@ public class SeasonalEventService(
return _weatherConfig.OverrideSeason.Value;
}
var currentDate = new DateTime();
var currentDate = _timeUtil.GetDateTimeNow();
foreach (var seasonRange in _weatherConfig.SeasonDates)
{
if (
+6 -1
View File
@@ -1,4 +1,4 @@
using SptCommon.Annotations;
using SptCommon.Annotations;
namespace Core.Utils;
@@ -44,6 +44,11 @@ public class TimeUtil
return FormatDate(DateTimeOffset.UtcNow);
}
public DateTime GetDateTimeNow()
{
return DateTime.UtcNow;
}
/// <summary>
/// Gets the current time as a formatted UTC string.
/// </summary>