From 28e061641414c82ffc73975e6da4aaf1a0d13bf6 Mon Sep 17 00:00:00 2001 From: Gonzalo Murillas Date: Tue, 17 May 2022 13:41:30 -0300 Subject: [PATCH] Fix monsters casting while stunned (#177) --- src/game/Object/Creature.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game/Object/Creature.cpp b/src/game/Object/Creature.cpp index 1a4267f8..90af05d5 100644 --- a/src/game/Object/Creature.cpp +++ b/src/game/Object/Creature.cpp @@ -3305,6 +3305,10 @@ SpellCastResult Creature::TryToCast(Unit* pTarget, const SpellEntry* pSpellInfo, return SPELL_FAILED_BAD_IMPLICIT_TARGETS; } + if (hasUnitState(UNIT_STAT_STUNNED)) { + return SPELL_FAILED_STUNNED; + } + // This spell should only be cast when target does not have the aura it applies. if ((uiCastFlags & CF_AURA_NOT_PRESENT) && pTarget->HasAura(pSpellInfo->Id)) {