diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index 99e5c4de9..a1854f5a1 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -669,25 +669,29 @@ class spell_kologarn_focused_eyebeam : public SpellScript } }; +namespace pitKillBoundary { + static auto const boundaryIntersect = new BoundaryIntersectBoundary( + new RectangleBoundary(1782.0f, 1832.0f, -56.0f, 8.0f), + new ZRangeBoundary(400.0f, 439.0f) + ); +} + struct boss_kologarn_pit_kill_bunny : public NullCreatureAI { - boss_kologarn_pit_kill_bunny(Creature* creature) : NullCreatureAI(creature) { } + explicit boss_kologarn_pit_kill_bunny(Creature* creature) : NullCreatureAI(creature) { } void Reset() override { - RectangleBoundary* _boundaryXY = new RectangleBoundary(1782.0f, 1832.0f, -56.0f, 8.0f); - ZRangeBoundary* _boundaryZ = new ZRangeBoundary(400.0f, 439.0f); - _boundaryIntersect = new BoundaryIntersectBoundary(_boundaryXY, _boundaryZ); - - scheduler.Schedule(0s, [this](TaskContext context) + scheduler.CancelAll(); + scheduler.Schedule(0s, + [this](TaskContext context) { me->GetMap()->DoForAllPlayers([&](Player* player) { - if (_boundaryIntersect->IsWithinBoundary(player->GetPosition()) && !player->IsGameMaster()) - { + if (pitKillBoundary::boundaryIntersect->IsWithinBoundary(player->GetPosition()) && !player->IsGameMaster()) player->KillSelf(false); - } }); + context.Repeat(1s); }); } @@ -696,8 +700,6 @@ struct boss_kologarn_pit_kill_bunny : public NullCreatureAI { scheduler.Update(diff); } -private: - BoundaryIntersectBoundary const* _boundaryIntersect; }; // predicate function to select non main tank target