Fix a crash caused by removecorpse

This commit is contained in:
megamage
2011-11-12 23:03:00 -05:00
parent 163515341e
commit 0bb964285f

View File

@@ -199,10 +199,10 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse)
{
ASSERT(corpse && corpse->GetType() != CORPSE_BONES);
if (Map* map = corpse->FindMap())
if (corpse->IsInGrid())
{
corpse->DestroyForNearbyPlayers();
map->RemoveFromMap(corpse, false);
corpse->GetMap()->RemoveFromMap(corpse, false);
}
else
corpse->RemoveFromWorld();