mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-27 20:32:21 +01:00
A temp fix for crash caused by remove corpse.
This commit is contained in:
@@ -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