refactor(Core): Make ObjectGuid const (#23170)

* cherry-pick commit (a7883380ce)

Co-Authored-By: Lucas Nascimento <keader.android@gmail.com>
This commit is contained in:
天鹭
2025-10-13 10:13:12 +08:00
committed by GitHub
parent 9c49349e1e
commit 8e2e30328f
51 changed files with 119 additions and 119 deletions

View File

@@ -2358,27 +2358,27 @@ void BattlegroundMap::RemoveAllPlayers()
player->TeleportTo(player->GetEntryPoint());
}
Corpse* Map::GetCorpse(ObjectGuid const guid)
Corpse* Map::GetCorpse(ObjectGuid const& guid)
{
return _objectsStore.Find<Corpse>(guid);
}
Creature* Map::GetCreature(ObjectGuid const guid)
Creature* Map::GetCreature(ObjectGuid const& guid)
{
return _objectsStore.Find<Creature>(guid);
}
GameObject* Map::GetGameObject(ObjectGuid const guid)
GameObject* Map::GetGameObject(ObjectGuid const& guid)
{
return _objectsStore.Find<GameObject>(guid);
}
Pet* Map::GetPet(ObjectGuid const guid)
Pet* Map::GetPet(ObjectGuid const& guid)
{
return dynamic_cast<Pet*>(_objectsStore.Find<Creature>(guid));
}
Transport* Map::GetTransport(ObjectGuid guid)
Transport* Map::GetTransport(ObjectGuid const& guid)
{
if (guid.GetHigh() != HighGuid::Mo_Transport && guid.GetHigh() != HighGuid::Transport)
return nullptr;
@@ -2387,7 +2387,7 @@ Transport* Map::GetTransport(ObjectGuid guid)
return go ? go->ToTransport() : nullptr;
}
DynamicObject* Map::GetDynamicObject(ObjectGuid guid)
DynamicObject* Map::GetDynamicObject(ObjectGuid const& guid)
{
return _objectsStore.Find<DynamicObject>(guid);
}
@@ -2679,7 +2679,7 @@ void Map::RemoveCorpse(Corpse* corpse)
_corpseBones.erase(corpse);
}
Corpse* Map::ConvertCorpseToBones(ObjectGuid const ownerGuid, bool insignia /*= false*/)
Corpse* Map::ConvertCorpseToBones(ObjectGuid const& ownerGuid, bool insignia /*= false*/)
{
Corpse* corpse = GetCorpseByPlayer(ownerGuid);
if (!corpse)

View File

@@ -338,12 +338,12 @@ public:
GameObject* SummonGameObject(uint32 entry, Position const& pos, float rotation0 = 0.0f, float rotation1 = 0.0f, float rotation2 = 0.0f, float rotation3 = 0.0f, uint32 respawnTime = 100, bool checkTransport = true);
void SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list = nullptr);
Corpse* GetCorpse(ObjectGuid const guid);
Creature* GetCreature(ObjectGuid const guid);
GameObject* GetGameObject(ObjectGuid const guid);
Transport* GetTransport(ObjectGuid const guid);
DynamicObject* GetDynamicObject(ObjectGuid const guid);
Pet* GetPet(ObjectGuid const guid);
Corpse* GetCorpse(ObjectGuid const& guid);
Creature* GetCreature(ObjectGuid const& guid);
GameObject* GetGameObject(ObjectGuid const& guid);
Transport* GetTransport(ObjectGuid const& guid);
DynamicObject* GetDynamicObject(ObjectGuid const& guid);
Pet* GetPet(ObjectGuid const& guid);
MapStoredObjectTypesContainer& GetObjectsStore() { return _objectsStore; }
@@ -438,7 +438,7 @@ public:
void DeleteCorpseData();
void AddCorpse(Corpse* corpse);
void RemoveCorpse(Corpse* corpse);
Corpse* ConvertCorpseToBones(ObjectGuid const ownerGuid, bool insignia = false);
Corpse* ConvertCorpseToBones(ObjectGuid const& ownerGuid, bool insignia = false);
void RemoveOldCorpses();
static void DeleteRespawnTimesInDB(uint16 mapId, uint32 instanceId);