diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellHandler.cpp | 10 |
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) { |