aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp14
-rw-r--r--src/game/SpellAuras.cpp9
2 files changed, 19 insertions, 4 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 132eb5fafb2..863530d953a 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -5129,9 +5129,21 @@ SpellCastResult Spell::CheckCast(bool strict)
}
break;
}
+ case SPELL_AURA_MOD_POSSESS_PET:
+ {
+ if(m_caster->GetTypeId() != TYPEID_PLAYER)
+ return SPELL_FAILED_NO_PET;
+
+ Pet *pet = ((Player*)m_caster)->GetPet();
+ if(!pet)
+ return SPELL_FAILED_NO_PET;
+
+ if(pet->GetCharmerGUID())
+ return SPELL_FAILED_CHARMED;
+ break;
+ }
case SPELL_AURA_MOD_POSSESS:
case SPELL_AURA_MOD_CHARM:
- case SPELL_AURA_MOD_POSSESS_PET:
case SPELL_AURA_AOE_CHARM:
{
if(m_caster->GetCharmerGUID())
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 0ae6c1fe8a9..9182d5d141f 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -6724,6 +6724,7 @@ void AuraEffect::HandleModPossess(bool apply, bool Real, bool /*changeAmount*/)
m_target->RemoveCharmedBy(caster);
}
+// only one spell has this aura
void AuraEffect::HandleModPossessPet(bool apply, bool Real, bool /*changeAmount*/)
{
if(!Real)
@@ -6733,10 +6734,11 @@ void AuraEffect::HandleModPossessPet(bool apply, bool Real, bool /*changeAmount*
if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
return;
+ if(((Player*)caster)->GetPet() != m_target)
+ return;
+
if(apply)
{
- if(caster->GetGuardianPet() != m_target)
- return;
m_target->SetCharmedBy(caster, CHARM_TYPE_POSSESS);
}
else
@@ -6748,7 +6750,8 @@ void AuraEffect::HandleModPossessPet(bool apply, bool Real, bool /*changeAmount*
if(!m_target->getVictim())
{
m_target->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, m_target->GetFollowAngle());
- m_target->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW);
+ if(m_target->GetCharmInfo())
+ m_target->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW);
}
}
}