mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
fix(Core/ObjectGuid): prevent creating copies when looping objects (#6852)
This commit is contained in:
@@ -291,7 +291,7 @@ public:
|
||||
events.RepeatEvent(30000);
|
||||
else
|
||||
{
|
||||
for (ObjectGuid guid : summons)
|
||||
for (ObjectGuid const& guid : summons)
|
||||
if (Creature* sv = ObjectAccessor::GetCreature(*me, guid))
|
||||
{
|
||||
sv->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
@@ -2321,7 +2321,7 @@ public:
|
||||
|
||||
void RemoveAll()
|
||||
{
|
||||
for (ObjectGuid guid : FlameList)
|
||||
for (ObjectGuid const& guid : FlameList)
|
||||
if (Creature* c = ObjectAccessor::GetCreature(*me, guid))
|
||||
c->DespawnOrUnsummon();
|
||||
FlameList.clear();
|
||||
|
||||
@@ -1219,7 +1219,7 @@ void instance_ulduar::instance_ulduar_InstanceMapScript::SpawnLeviathanEncounter
|
||||
{
|
||||
if (!_leviathanVehicles.empty())
|
||||
{
|
||||
for (ObjectGuid guid : _leviathanVehicles)
|
||||
for (ObjectGuid const& guid : _leviathanVehicles)
|
||||
if (Creature* cr = instance->GetCreature(guid))
|
||||
if (Vehicle* veh = cr->GetVehicleKit())
|
||||
veh->Dismiss();
|
||||
|
||||
Reference in New Issue
Block a user