mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
fix(Core/ObjectGuid): prevent creating copies when looping objects (#6852)
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user