diff options
| author | Francesco Borzì <borzifrancesco@gmail.com> | 2021-07-10 15:54:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-10 15:54:16 +0200 |
| commit | 4103fca5a4e4ea589d0ee55691260ee62898cc24 (patch) | |
| tree | 82cddf64c6050e9a46587e082ff3a0ae01356a75 /src/server/scripts/Events | |
| parent | 2fcafa5f3915577dd921349ef5c2dcf56aa9f896 (diff) | |
fix(Core/ObjectGuid): prevent creating copies when looping objects (#6852)
Diffstat (limited to 'src/server/scripts/Events')
| -rw-r--r-- | src/server/scripts/Events/hallows_end.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/scripts/Events/hallows_end.cpp b/src/server/scripts/Events/hallows_end.cpp index b2300deba9..7349abf4ff 100644 --- a/src/server/scripts/Events/hallows_end.cpp +++ b/src/server/scripts/Events/hallows_end.cpp @@ -699,7 +699,7 @@ public: if (counter > 12) { bool failed = false; - for (ObjectGuid const guid : unitList) + for (ObjectGuid const& guid : unitList) if (Unit* c = ObjectAccessor::GetUnit(*me, guid)) if (c->HasAuraType(SPELL_AURA_PERIODIC_DUMMY)) { @@ -753,7 +753,7 @@ public: Unit* getTrigger() { std::list<Unit*> tmpList; - for (ObjectGuid const guid : unitList) + for (ObjectGuid const& guid : unitList) if (Unit* c = ObjectAccessor::GetUnit(*me, guid)) if (!c->HasAuraType(SPELL_AURA_PERIODIC_DUMMY)) tmpList.push_back(c); @@ -772,7 +772,7 @@ public: { me->MonsterYell("Fire consumes! You've tried and failed. Let there be no doubt, justice prevailed!", LANG_UNIVERSAL, 0); me->PlayDirectSound(11967); - for (ObjectGuid const guid : unitList) + for (ObjectGuid const& guid : unitList) if (Unit* c = ObjectAccessor::GetUnit(*me, guid)) c->RemoveAllAuras(); |
