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

@@ -28,6 +28,7 @@
#include "Formulas.h"
#include "GameObject.h"
#include "GameObjectAI.h"
#include "GameTime.h"
#include "GossipDef.h"
#include "GridNotifiers.h"
#include "Group.h"
@@ -686,7 +687,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
case 17731:
case 69294:
{
if( !gameObjTarget || gameObjTarget->GetRespawnTime() > time(nullptr) )
if( !gameObjTarget || gameObjTarget->GetRespawnTime() > GameTime::GetGameTime().count() )
return;
gameObjTarget->SetRespawnTime(10);
@@ -4305,7 +4306,7 @@ void Spell::EffectSanctuary(SpellEffIndex /*effIndex*/)
}
// Xinef: Set last sanctuary time
unitTarget->m_lastSanctuaryTime = World::GetGameTimeMS();
unitTarget->m_lastSanctuaryTime = GameTime::GetGameTimeMS().count();
// Vanish allows to remove all threat and cast regular stealth so other spells can be used
if (m_caster->GetTypeId() == TYPEID_PLAYER
@@ -5079,7 +5080,7 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
// charge changes fall time
if( m_caster->GetTypeId() == TYPEID_PLAYER )
m_caster->ToPlayer()->SetFallInformation(time(nullptr), m_caster->GetPositionZ());
m_caster->ToPlayer()->SetFallInformation(GameTime::GetGameTime().count(), m_caster->GetPositionZ());
ObjectGuid targetGUID = ObjectGuid::Empty;
if (!m_spellInfo->IsPositive() && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->GetTarget() == unitTarget->GetGUID())
@@ -5224,7 +5225,7 @@ void Spell::EffectLeapBack(SpellEffIndex effIndex)
// xinef: changes fall time
if (m_caster->GetTypeId() == TYPEID_PLAYER)
m_caster->ToPlayer()->SetFallInformation(time(nullptr), m_caster->GetPositionZ());
m_caster->ToPlayer()->SetFallInformation(GameTime::GetGameTime().count(), m_caster->GetPositionZ());
}
void Spell::EffectQuestClear(SpellEffIndex effIndex)