mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 11:21:58 +01:00
*A better fix of 4974.
--HG-- branch : trunk
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user