*Fix a crash caused by possesspet spells.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-07 00:52:30 -06:00
parent b49732c04d
commit 6ae4f909d0
+4 -1
View File
@@ -2873,11 +2873,14 @@ void Aura::HandleModPossessPet(bool apply, bool Real)
Unit* caster = GetCaster(); Unit* caster = GetCaster();
if(!caster || caster->GetTypeId() != TYPEID_PLAYER) if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
return; return;
if(apply)
{
if(caster->GetPet() != m_target) if(caster->GetPet() != m_target)
return; return;
if(apply)
m_target->SetCharmedOrPossessedBy(caster, true); m_target->SetCharmedOrPossessedBy(caster, true);
}
else else
{ {
m_target->RemoveCharmedOrPossessedBy(caster); m_target->RemoveCharmedOrPossessedBy(caster);