mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-17 17:24:33 +00:00
fix(Core/ObjectGuid): prevent creating copies when looping objects (#6852)
This commit is contained in:
@@ -958,7 +958,7 @@ public:
|
||||
|
||||
TSSpawnPos.GetAngle(&TSMidPos);
|
||||
|
||||
for (ObjectGuid guid : summons)
|
||||
for (ObjectGuid const& guid : summons)
|
||||
if (Creature* c = pInstance->instance->GetCreature(guid))
|
||||
{
|
||||
float hx, hy, hz, ho;
|
||||
@@ -974,7 +974,7 @@ public:
|
||||
if (pInstance)
|
||||
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_SINDRAGOSA_GUID)))
|
||||
{
|
||||
for (ObjectGuid guid : summons)
|
||||
for (ObjectGuid const& guid : summons)
|
||||
if (Creature* s = pInstance->instance->GetCreature(guid))
|
||||
if (s->IsAlive())
|
||||
Unit::Kill(c, s);
|
||||
@@ -1026,7 +1026,7 @@ public:
|
||||
me->SetFacingTo(5.26f);
|
||||
me->SetOrientation(5.26f);
|
||||
me->SetHomePosition(*me);
|
||||
for (ObjectGuid guid : summons)
|
||||
for (ObjectGuid const& guid : summons)
|
||||
if (Creature* c = pInstance->instance->GetCreature(guid))
|
||||
{
|
||||
c->SetFacingTo(5.26f);
|
||||
@@ -1056,7 +1056,7 @@ public:
|
||||
float offset = frand(0.0f, 10.0f);
|
||||
c->GetMotionMaster()->MovePoint(0, 1047.0f + offset, 118.0f + offset, 628.2f);
|
||||
c->SetHomePosition(*me);
|
||||
for (ObjectGuid guid : summons)
|
||||
for (ObjectGuid const& guid : summons)
|
||||
if (Creature* s = pInstance->instance->GetCreature(guid))
|
||||
{
|
||||
if (s->GetEntry() == NPC_FALLEN_WARRIOR)
|
||||
|
||||
Reference in New Issue
Block a user