diff options
-rw-r--r-- | src/game/ObjectAccessor.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index 7325f774043..348490806b6 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -266,10 +266,10 @@ ObjectAccessor::RemoveCorpse(Corpse *corpse) uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; objmgr.DeleteCorpseCellData(corpse->GetMapId(), cell_id, corpse->GetOwnerGUID()); - corpse->RemoveFromWorld(); - // map reset in ObjectAccessor::ConvertCorpseForPlayer - //if(corpse->FindMap()) - // corpse->ResetMap(); + if(corpse->FindMap()) + corpse->FindMap()->Remove(corpse, false); + else + corpse->RemoveFromWorld(); i_player2corpse.erase(iter); } @@ -326,14 +326,17 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia) DEBUG_LOG("Deleting Corpse and spawning bones."); + Map *map = corpse->FindMap(); + // remove corpse from player_guid -> corpse map RemoveCorpse(corpse); + // done in removecorpse // remove resurrectable corpse from grid object registry (loaded state checked into call) // do not load the map if it's not loaded - Map *map = MapManager::Instance().FindMap(corpse->GetMapId(), corpse->GetInstanceId()); - if(map) - map->Remove(corpse, false); + //Map *map = MapManager::Instance().FindMap(corpse->GetMapId(), corpse->GetInstanceId()); + //if(map) + // map->Remove(corpse, false); // remove corpse from DB corpse->DeleteFromDB(); |