Fix a crash caused by removecorpse

This commit is contained in:
megamage
2011-11-12 23:04:51 -05:00
parent 163515341e
commit 0bb964285f
+2 -2
View File
@@ -199,10 +199,10 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse)
{ {
ASSERT(corpse && corpse->GetType() != CORPSE_BONES); ASSERT(corpse && corpse->GetType() != CORPSE_BONES);
if (Map* map = corpse->FindMap()) if (corpse->IsInGrid())
{ {
corpse->DestroyForNearbyPlayers(); corpse->DestroyForNearbyPlayers();
map->RemoveFromMap(corpse, false); corpse->GetMap()->RemoveFromMap(corpse, false);
} }
else else
corpse->RemoveFromWorld(); corpse->RemoveFromWorld();