aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-27 11:32:46 -0500
committermegamage <none@none>2009-08-27 11:32:46 -0500
commit56bdb0fc6b61afb495793868c58514a516ffe4b0 (patch)
tree5080d1795b59ac31ac8602f661478559874e1b85 /src/game
parent71860b5024744bb80364e1ce9d21f0f600cb231d (diff)
*Fix a crash caused by possess pet. Thanks to nanouniko
--HG-- branch : trunk
Diffstat (limited to 'src/game')
-rw-r--r--src/game/SpellAuras.cpp12
-rw-r--r--src/game/SpellHandler.cpp5
2 files changed, 12 insertions, 5 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index e586061a61f..6952b9d7859 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -6735,11 +6735,15 @@ void AuraEffect::HandleModPossessPet(bool apply, bool Real, bool /*changeAmount*
if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
return;
- if(((Player*)caster)->GetPet() != m_target)
- return;
+ //seems it may happen that when removing it is no longer owner's pet
+ //if(((Player*)caster)->GetPet() != m_target)
+ // return;
if(apply)
{
+ if(((Player*)caster)->GetPet() != m_target)
+ return;
+
m_target->SetCharmedBy(caster, CHARM_TYPE_POSSESS);
}
else
@@ -6751,8 +6755,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());
- if(m_target->GetCharmInfo())
- m_target->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW);
+ //if(m_target->GetCharmInfo())
+ // m_target->GetCharmInfo()->SetCommandState(COMMAND_FOLLOW);
}
}
}
diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp
index c3be5007cdf..6dc55e6d114 100644
--- a/src/game/SpellHandler.cpp
+++ b/src/game/SpellHandler.cpp
@@ -526,8 +526,11 @@ void WorldSession::HandleSpellClick( WorldPacket & recv_data )
// TODO: Unit::SetCharmedBy: 28782 is not in world but 0 is trying to charm it! -> crash
if(!unit->IsInWorld())
+ {
+ sLog.outCrash("Spell click target %u is not in world!", unit->GetEntry());
+ assert(false);
return;
-
+ }
SpellClickInfoMapBounds clickPair = objmgr.GetSpellClickInfoMapBounds(unit->GetEntry());
for(SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)