*A temp fix for the crash caused by creature 28782

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-27 11:08:55 -05:00
parent 94b8532c4f
commit 71860b5024
+7 -3
View File
@@ -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)
{