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
129 changed files with 1147 additions and 817 deletions

View File

@@ -29,6 +29,7 @@
#include "Cell.h"
#include "CellImpl.h"
#include "Chat.h"
#include "GameTime.h"
#include "GridNotifiers.h"
#include "Group.h"
#include "InstanceScript.h"
@@ -2250,12 +2251,12 @@ class spell_gen_turkey_marker : public AuraScript
{
if (GetStackAmount() > stackAmount)
{
_applyTimes.push_back(World::GetGameTimeMS());
_applyTimes.push_back(GameTime::GetGameTimeMS().count());
stackAmount++;
}
// pop stack if it expired for us
if (_applyTimes.front() + GetMaxDuration() < World::GetGameTimeMS())
if (_applyTimes.front() + GetMaxDuration() < GameTime::GetGameTimeMS().count())
{
stackAmount--;
ModStackAmount(-1, AURA_REMOVE_BY_EXPIRE);

View File

@@ -22,6 +22,7 @@
*/
#include "Battleground.h"
#include "GameTime.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
@@ -2716,11 +2717,13 @@ class spell_item_crystal_prison_dummy_dnd : public SpellScript
void HandleDummy(SpellEffIndex /* effIndex */)
{
if (Creature* target = GetHitCreature())
{
if (target->isDead() && !target->IsPet())
{
GetCaster()->SummonGameObject(OBJECT_IMPRISONED_DOOMGUARD, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0, 0, 0, 0, uint32(target->GetRespawnTime() - time(nullptr)));
GetCaster()->SummonGameObject(OBJECT_IMPRISONED_DOOMGUARD, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0, 0, 0, 0, uint32(target->GetRespawnTime() - GameTime::GetGameTime().count()));
target->DespawnOrUnsummon();
}
}
}
void Register() override