fix(Core/Entities): crash fix cause by a pointer change in #19622 (#19633)

* fix(Core/Entities): crash fix cause by a pointer change in #19622

* fix blank space for codestyle check
This commit is contained in:
Grimdhex
2024-08-15 21:28:50 +02:00
committed by GitHub
parent 7457aef78d
commit 9dc20bc261
8 changed files with 49 additions and 44 deletions

View File

@@ -334,24 +334,6 @@ Unit::Unit(bool isWorldObject) : WorldObject(isWorldObject),
_lastExtraAttackSpell = 0;
}
////////////////////////////////////////////////////////////
// Methods of class GlobalCooldownMgr
bool GlobalCooldownMgr::HasGlobalCooldown(SpellInfo const* spellInfo) const
{
GlobalCooldownList::const_iterator itr = m_GlobalCooldowns.find(spellInfo->StartRecoveryCategory);
return itr != m_GlobalCooldowns.end() && itr->second.duration && getMSTimeDiff(itr->second.cast_time, GameTime::GetGameTimeMS().count()) < itr->second.duration;
}
void GlobalCooldownMgr::AddGlobalCooldown(SpellInfo const* spellInfo, uint32 gcd)
{
m_GlobalCooldowns[spellInfo->StartRecoveryCategory] = GlobalCooldown(gcd, GameTime::GetGameTimeMS().count());
}
void GlobalCooldownMgr::CancelGlobalCooldown(SpellInfo const* spellInfo)
{
m_GlobalCooldowns[spellInfo->StartRecoveryCategory].duration = 0;
}
////////////////////////////////////////////////////////////
// Methods of class Unit
Unit::~Unit()