fix(Core/ObjectGuid): prevent creating copies when looping objects (#6852)

This commit is contained in:
Francesco Borzì
2021-07-10 15:54:16 +02:00
committed by GitHub
parent 2fcafa5f39
commit 4103fca5a4
40 changed files with 69 additions and 69 deletions

View File

@@ -369,7 +369,7 @@ public:
{
// shouldn't be casted on any victim of summoned mobs
bool valid = true;
for (ObjectGuid const guid : summons)
for (ObjectGuid const& guid : summons)
if (Creature* c = ObjectAccessor::GetCreature(*me, guid))
if (c->IsAlive() && c->GetVictim() && c->GetVictim()->GetGUID() == plr->GetGUID())
{