Core/Spell Mechanics: introduce global cooldown manager for server-side checks for GCD (ported from mangos)

This commit is contained in:
darkstalker
2011-02-22 17:02:47 +06:00
committed by Azazel
parent 401ec2180f
commit 1646f9d91c
9 changed files with 130 additions and 18 deletions
+4 -1
View File
@@ -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())
{