Core/Misc: Handle timezones for hour-specific events specifieds in worldserver.conf

Port From (https://github.com/TrinityCore/TrinityCore/commit/493fe066f6b107a9f356d693c5d37d878d3a63eb)
This commit is contained in:
hondacrx
2022-01-01 16:35:15 -05:00
parent a4c4897b4d
commit 9b3fe829d6
4 changed files with 27 additions and 13 deletions
+3 -2
View File
@@ -34,9 +34,10 @@ namespace Scripts.World
bool IsXPBoostActive()
{
var now = Time.UnixTimeToDateTime(GameTime.GetGameTime());
long time = GameTime.GetGameTime();
var localTm = Time.UnixTimeToDateTime(time);
uint weekdayMaskBoosted = WorldConfig.GetUIntValue(WorldCfg.XpBoostDaymask);
uint weekdayMask = (1u << now.Day);
uint weekdayMask = 1u << localTm.Day;
bool currentDayBoosted = (weekdayMask & weekdayMaskBoosted) != 0;
return currentDayBoosted;
}