mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 06:06:23 +00:00
fix(Core/ObjectGuid): prevent creating copies when looping objects (#6852)
This commit is contained in:
@@ -220,7 +220,7 @@ public:
|
||||
{
|
||||
if (!m_uiAncientGemGUID.empty())
|
||||
{
|
||||
for (ObjectGuid const guid : m_uiAncientGemGUID)
|
||||
for (ObjectGuid const& guid : m_uiAncientGemGUID)
|
||||
{
|
||||
//don't know how long it expected
|
||||
DoRespawnGameObject(guid, DAY);
|
||||
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
instance->LoadGrid(instancePositions[0].GetPositionX(), instancePositions[0].GetPositionY());
|
||||
instance->LoadGrid(instancePositions[1].GetPositionX(), instancePositions[1].GetPositionY());
|
||||
|
||||
for (ObjectGuid const guid : _prisonersSet)
|
||||
for (ObjectGuid const& guid : _prisonersSet)
|
||||
if (Creature* orc = instance->GetCreature(guid))
|
||||
{
|
||||
uint8 index = orc->GetDistance(instancePositions[0]) < 80.0f ? 0 : 1;
|
||||
@@ -193,7 +193,7 @@ public:
|
||||
orc->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
}
|
||||
|
||||
for (ObjectGuid const guid : _initalFlamesSet)
|
||||
for (ObjectGuid const& guid : _initalFlamesSet)
|
||||
if (GameObject* gobject = instance->GetGameObject(guid))
|
||||
{
|
||||
gobject->SetRespawnTime(0);
|
||||
@@ -215,14 +215,14 @@ public:
|
||||
player->KilledMonsterCredit(NPC_LODGE_QUEST_TRIGGER);
|
||||
}
|
||||
|
||||
for (ObjectGuid const guid : _finalFlamesSet)
|
||||
for (ObjectGuid const& guid : _finalFlamesSet)
|
||||
if (GameObject* gobject = instance->GetGameObject(guid))
|
||||
{
|
||||
gobject->SetRespawnTime(0);
|
||||
gobject->UpdateObjectVisibility(true);
|
||||
}
|
||||
|
||||
for (ObjectGuid const guid : _prisonersSet)
|
||||
for (ObjectGuid const& guid : _prisonersSet)
|
||||
if (Creature* orc = instance->GetCreature(guid))
|
||||
if (roll_chance_i(25))
|
||||
orc->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
}
|
||||
|
||||
GuidSet eCopy = encounterNPCs;
|
||||
for (ObjectGuid const guid : eCopy)
|
||||
for (ObjectGuid const& guid : eCopy)
|
||||
if (Creature* creature = instance->GetCreature(guid))
|
||||
creature->DespawnOrUnsummon();
|
||||
}
|
||||
@@ -184,7 +184,7 @@ public:
|
||||
|
||||
// Xinef: delete all spawns
|
||||
GuidSet eCopy = encounterNPCs;
|
||||
for (ObjectGuid guid : eCopy)
|
||||
for (ObjectGuid const& guid : eCopy)
|
||||
if (Creature* creature = instance->GetCreature(guid))
|
||||
creature->DespawnOrUnsummon();
|
||||
}
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
void SummonPortalKeeper()
|
||||
{
|
||||
Creature* rift = nullptr;
|
||||
for (ObjectGuid const guid : encounterNPCs)
|
||||
for (ObjectGuid const& guid : encounterNPCs)
|
||||
if (Creature* summon = instance->GetCreature(guid))
|
||||
if (summon->GetEntry() == NPC_TIME_RIFT)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user