mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/ObjectMgr: Switched to full guids in cell corpse container
This commit is contained in:
@@ -314,7 +314,7 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse)
|
||||
|
||||
// build mapid*cellid -> guid_set map
|
||||
CellCoord cellCoord = Trinity::ComputeCellCoord(corpse->GetPositionX(), corpse->GetPositionY());
|
||||
sObjectMgr->DeleteCorpseCellData(corpse->GetMapId(), cellCoord.GetId(), corpse->GetOwnerGUID().GetCounter());
|
||||
sObjectMgr->DeleteCorpseCellData(corpse->GetMapId(), cellCoord.GetId(), corpse->GetOwnerGUID());
|
||||
|
||||
i_player2corpse.erase(iter);
|
||||
}
|
||||
@@ -333,7 +333,7 @@ void ObjectAccessor::AddCorpse(Corpse* corpse)
|
||||
|
||||
// build mapid*cellid -> guid_set map
|
||||
CellCoord cellCoord = Trinity::ComputeCellCoord(corpse->GetPositionX(), corpse->GetPositionY());
|
||||
sObjectMgr->AddCorpseCellData(corpse->GetMapId(), cellCoord.GetId(), corpse->GetOwnerGUID().GetCounter(), corpse->GetInstanceId());
|
||||
sObjectMgr->AddCorpseCellData(corpse->GetMapId(), cellCoord.GetId(), corpse->GetOwnerGUID(), corpse->GetInstanceId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7445,14 +7445,14 @@ void ObjectMgr::DeleteGOData(uint32 guid)
|
||||
_gameObjectDataStore.erase(guid);
|
||||
}
|
||||
|
||||
void ObjectMgr::AddCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_guid, uint32 instance)
|
||||
void ObjectMgr::AddCorpseCellData(uint32 mapid, uint32 cellid, ObjectGuid player_guid, uint32 instance)
|
||||
{
|
||||
// corpses are always added to spawn mode 0 and they are spawned by their instance id
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(mapid, 0)][cellid];
|
||||
cell_guids.corpses[player_guid] = instance;
|
||||
}
|
||||
|
||||
void ObjectMgr::DeleteCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_guid)
|
||||
void ObjectMgr::DeleteCorpseCellData(uint32 mapid, uint32 cellid, ObjectGuid player_guid)
|
||||
{
|
||||
// corpses are always added to spawn mode 0 and they are spawned by their instance id
|
||||
CellObjectGuids& cell_guids = _mapObjectGuidsStore[MAKE_PAIR32(mapid, 0)][cellid];
|
||||
|
||||
@@ -480,7 +480,7 @@ struct BroadcastText
|
||||
typedef std::unordered_map<uint32, BroadcastText> BroadcastTextContainer;
|
||||
|
||||
typedef std::set<uint32> CellGuidSet;
|
||||
typedef std::map<uint32/*player guid*/, uint32/*instance*/> CellCorpseSet;
|
||||
typedef std::map<ObjectGuid/*player guid*/, uint32/*instance*/> CellCorpseSet;
|
||||
struct CellObjectGuids
|
||||
{
|
||||
CellGuidSet creatures;
|
||||
@@ -1220,8 +1220,8 @@ class ObjectMgr
|
||||
LocaleConstant GetDBCLocaleIndex() const { return DBCLocaleIndex; }
|
||||
void SetDBCLocaleIndex(LocaleConstant locale) { DBCLocaleIndex = locale; }
|
||||
|
||||
void AddCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_guid, uint32 instance);
|
||||
void DeleteCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_guid);
|
||||
void AddCorpseCellData(uint32 mapid, uint32 cellid, ObjectGuid player_guid, uint32 instance);
|
||||
void DeleteCorpseCellData(uint32 mapid, uint32 cellid, ObjectGuid player_guid);
|
||||
|
||||
// grid objects
|
||||
void AddCreatureToGrid(uint32 guid, CreatureData const* data);
|
||||
|
||||
@@ -141,9 +141,7 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellCoord &cell, CorpseMapTyp
|
||||
if (itr->second != map->GetInstanceId())
|
||||
continue;
|
||||
|
||||
ObjectGuid player_guid(HIGHGUID_PLAYER, itr->first);
|
||||
|
||||
Corpse* obj = sObjectAccessor->GetCorpseForPlayerGUID(player_guid);
|
||||
Corpse* obj = sObjectAccessor->GetCorpseForPlayerGUID(itr->first);
|
||||
if (!obj)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user