feat(Core/Time): Implement saparated manager for game time (#8630)

This commit is contained in:
Kargatum 2022-01-24 17:55:00 +07:00 committed by GitHub
parent 12da792a90
commit 8b7df23f06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
129 changed files with 1147 additions and 817 deletions

View file

@ -43,6 +43,7 @@ EndContentData */
#include "CellImpl.h"
#include "GameObjectAI.h"
#include "GameTime.h"
#include "GridNotifiersImpl.h"
#include "Player.h"
#include "ScriptMgr.h"
@ -1414,7 +1415,7 @@ class go_inconspicuous_landmark : public GameObjectScript
public:
go_inconspicuous_landmark() : GameObjectScript("go_inconspicuous_landmark")
{
_lastUsedTime = time(nullptr);
_lastUsedTime = GameTime::GetGameTime().count();
}
bool OnGossipHello(Player* player, GameObject* /*go*/) override
@ -1422,10 +1423,10 @@ public:
if (player->HasItemCount(ITEM_CUERGOS_KEY))
return true;
if (_lastUsedTime > time(nullptr))
if (_lastUsedTime > GameTime::GetGameTime().count())
return true;
_lastUsedTime = time(nullptr) + MINUTE;
_lastUsedTime = GameTime::GetGameTime().count() + MINUTE;
player->CastSpell(player, SPELL_SUMMON_PIRATES_TREASURE_AND_TRIGGER_MOB, true);
return true;
}