From 6b19d80f72c475e6e3fdcfb21944b7c3500402bf Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 13 Aug 2009 11:35:23 -0500 Subject: *A better fix of 4974. --HG-- branch : trunk --- src/game/ObjectAccessor.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/game/ObjectAccessor.cpp') 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(); -- cgit v1.2.3