A temp fix for crash caused by remove corpse.
This commit is contained in:
1 parent
28102c5683
commit
10b89d976f
1 file changed
+9
-2
@@ -199,10 +199,17 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse)
|
||||
{
|
||||
ASSERT(corpse && corpse->GetType() != CORPSE_BONES);
|
||||
|
||||
if (corpse->IsInGrid())
|
||||
//TODO: more works need to be done for corpse and other world object
|
||||
if (Map* map = corpse->FindMap())
|
||||
{
|
||||
corpse->DestroyForNearbyPlayers();
|
||||
corpse->GetMap()->RemoveFromMap(corpse, false);
|
||||
if (corpse->IsInGrid())
|
||||
map->RemoveFromMap(corpse, false);
|
||||
else
|
||||
{
|
||||
corpse->RemoveFromWorld();
|
||||
corpse->ResetMap();
|
||||
}
|
||||
}
|
||||
else
|
||||
corpse->RemoveFromWorld();
|
||||
|
||||
Reference in new issue
Block a user