aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-27 11:08:55 -0500
committermegamage <none@none>2009-08-27 11:08:55 -0500
commit71860b5024744bb80364e1ce9d21f0f600cb231d (patch)
tree29c1a8dde66f60a88162e9c4bd67ecae1ad3756c /src
parent94b8532c4fe95b4d31f088f3925df7637c13b9b1 (diff)
*A temp fix for the crash caused by creature 28782
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellHandler.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp
index 73544c9eed1..c3be5007cdf 100644
--- a/src/game/SpellHandler.cpp
+++ b/src/game/SpellHandler.cpp
@@ -519,12 +519,16 @@ void WorldSession::HandleSpellClick( WorldPacket & recv_data )
recv_data >> guid;
// this will get something not in world. crash
- //Creature *unit = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
- Creature *unit = Unit::GetCreature(*_player, guid);
-
+ Creature *unit = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
+
if(!unit)
return;
+ // TODO: Unit::SetCharmedBy: 28782 is not in world but 0 is trying to charm it! -> crash
+ if(!unit->IsInWorld())
+ return;
+
+
SpellClickInfoMapBounds clickPair = objmgr.GetSpellClickInfoMapBounds(unit->GetEntry());
for(SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
{