Core/Calendar: Implement different timezone support for ingame calendar

Port From (https://github.com/TrinityCore/TrinityCore/commit/b888b1b09f71a8b8b4a9d45c804a1f164fb65ac3)
This commit is contained in:
hondacrx
2024-02-21 16:36:19 -05:00
parent 47a64b8782
commit 0f4130704a
25 changed files with 831 additions and 322 deletions
+11 -3
View File
@@ -2224,10 +2224,18 @@ namespace Game
if (condition.Time[0] != 0)
{
var from = Time.GetUnixTimeFromPackedTime(condition.Time[0]);
var to = Time.GetUnixTimeFromPackedTime(condition.Time[1]);
WowTime time0 = new();
time0.SetPackedTime(condition.Time[0]);
if (GameTime.GetGameTime() < from || GameTime.GetGameTime() > to)
if (condition.Time[1] != 0)
{
WowTime time1 = new();
time1.SetPackedTime(condition.Time[1]);
if (!GameTime.GetWowTime().IsInRange(time0, time1))
return false;
}
else if (GameTime.GetWowTime() != time0)
return false;
}