mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
fix(Core/ObjectGuid): prevent creating copies when looping objects (#6852)
This commit is contained in:
@@ -169,7 +169,7 @@ public:
|
||||
case DATA_RAZORGORE_THE_UNTAMED:
|
||||
if (state == DONE)
|
||||
{
|
||||
for (ObjectGuid const guid : EggList)
|
||||
for (ObjectGuid const& guid : EggList)
|
||||
if (GameObject* egg = instance->GetGameObject(guid))
|
||||
egg->SetPhaseMask(2, true);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case DATA_ERANIKUS_FIGHT:
|
||||
for (ObjectGuid const guid : _dragonkinList)
|
||||
for (ObjectGuid const& guid : _dragonkinList)
|
||||
{
|
||||
if (Creature* creature = instance->GetCreature(guid))
|
||||
if (instance->IsGridLoaded(creature->GetPositionX(), creature->GetPositionY()))
|
||||
|
||||
@@ -1086,7 +1086,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
for (ObjectGuid const guid : allianceGuardsGUID)
|
||||
for (ObjectGuid const& guid : allianceGuardsGUID)
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, guid))
|
||||
temp->DespawnOrUnsummon();
|
||||
|
||||
@@ -2415,7 +2415,7 @@ public:
|
||||
SaurfangGUID.Clear();
|
||||
}
|
||||
|
||||
for (ObjectGuid const guid : hordeGuardsGUID)
|
||||
for (ObjectGuid const& guid : hordeGuardsGUID)
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, guid))
|
||||
temp->DespawnOrUnsummon();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user