From 975a6fccabf850c4270b9d652ffcbad13e4b87f3 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Sun, 12 Nov 2023 20:30:23 -0300 Subject: [PATCH] =?UTF-8?q?feat(Core/Scripts):=20Prevent=20the=20inherited?= =?UTF-8?q?=20TaskScheduler=20from=20updating=E2=80=A6=20(#17689)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 79e32319c..ef87ec6f1 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -556,6 +556,13 @@ BossAI::BossAI(Creature* creature, uint32 bossId) : ScriptedAI(creature), { if (instance) SetBoundary(instance->GetBossBoundary(bossId)); + + // Prevents updating the scheduler's timer while the creature is casting. + // Clear it in the script if you need it to update while the creature is casting. + scheduler.SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }); } bool BossAI::CanRespawn()