*A better fix of 4974.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-13 11:35:23 -05:00
parent a5ae817695
commit 6b19d80f72

View File

@@ -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();