aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNay <dnpd.dd@gmail.com>2012-04-21 09:19:23 -0700
committerNay <dnpd.dd@gmail.com>2012-04-21 09:19:23 -0700
commitc06012d054f976cad8d3ecc322feb23d8ad9366d (patch)
tree62b7210e6e1969fc2cff7beb5888f451f13fa757 /src
parent5c3ee06f49d0061ef78042a637f5ca5dc787f2ab (diff)
parente9fd6d19798c25f2971f37cd270722efac279cdf (diff)
Merge pull request #6272 from MrSmite/PetAI_attackFix
Core/Pets: Fix pets attacking on non-harmful spells (Hunter Mark and others)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index df2b9c35320..f055d669925 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3107,13 +3107,13 @@ void Spell::cast(bool skipCheck)
// should be done before the spell is actually executed
sScriptMgr->OnPlayerSpellCast(playerCaster, this, skipCheck);
- // Let any pets know we've attacked something. As of 3.0.2 pets begin
- // attacking their owner's target immediately
- if (Pet* playerPet = playerCaster->GetPet())
- {
- if (playerPet->isAlive() && playerPet->isControlled() && (m_targets.GetTargetMask() & TARGET_FLAG_UNIT))
- playerPet->AI()->OwnerAttacked(m_targets.GetObjectTarget()->ToUnit());
- }
+ // As of 3.0.2 pets begin attacking their owner's target immediately
+ // Let any pets know we've attacked something. Check DmgClass for harmful spells only
+ // This prevents spells such as Hunter's Mark from triggering pet attack
+ if (this->GetSpellInfo()->DmgClass != SPELL_DAMAGE_CLASS_NONE)
+ if (Pet* playerPet = playerCaster->GetPet())
+ if (playerPet->isAlive() && playerPet->isControlled() && (m_targets.GetTargetMask() & TARGET_FLAG_UNIT))
+ playerPet->AI()->OwnerAttacked(m_targets.GetObjectTarget()->ToUnit());
}
SetExecutedCurrently(true);