*A temp fix for the crash caused by creature 28782
--HG-- branch : trunk
This commit is contained in:
@@ -519,12 +519,16 @@ void WorldSession::HandleSpellClick( WorldPacket & recv_data )
|
|||||||
recv_data >> guid;
|
recv_data >> guid;
|
||||||
|
|
||||||
// this will get something not in world. crash
|
// this will get something not in world. crash
|
||||||
//Creature *unit = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
|
Creature *unit = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
|
||||||
Creature *unit = Unit::GetCreature(*_player, guid);
|
|
||||||
|
|
||||||
if(!unit)
|
if(!unit)
|
||||||
return;
|
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());
|
SpellClickInfoMapBounds clickPair = objmgr.GetSpellClickInfoMapBounds(unit->GetEntry());
|
||||||
for(SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
|
for(SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user