Core/Spell Mechanics: introduce global cooldown manager for server-side checks for GCD (ported from mangos)
This commit is contained in:
@@ -122,7 +122,7 @@ void PetAI::UpdateAI(const uint32 diff)
|
||||
return;
|
||||
|
||||
// Autocast (casted only in combat or persistent spells in any state)
|
||||
if (me->GetGlobalCooldown() == 0 && !me->HasUnitState(UNIT_STAT_CASTING))
|
||||
if (!me->HasUnitState(UNIT_STAT_CASTING))
|
||||
{
|
||||
typedef std::vector<std::pair<Unit*, Spell*> > TargetSpellList;
|
||||
TargetSpellList targetSpellStore;
|
||||
@@ -137,6 +137,9 @@ void PetAI::UpdateAI(const uint32 diff)
|
||||
if (!spellInfo)
|
||||
continue;
|
||||
|
||||
if (me->GetCharmInfo() && me->GetCharmInfo()->GetGlobalCooldownMgr().HasGlobalCooldown(spellInfo))
|
||||
continue;
|
||||
|
||||
// ignore some combinations of combat state and combat/noncombat spells
|
||||
if (!me->getVictim())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user