From 9f5b01ab37ad11fbace320b742eb9831766c3dda Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Wed, 17 Jul 2024 12:49:43 +0200 Subject: [PATCH] fix(Core/Unit): add melee spell breaking for spells with cast time (#19376) melee spells breaking --- src/server/game/Entities/Unit/Unit.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 78a832ca6..e2c636f86 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3959,6 +3959,16 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); m_AutoRepeatFirstCast = true; } + + // melee spells breaking + if (m_currentSpells[CURRENT_MELEE_SPELL]) + { + // break melee spells if cast time + if (pSpell->GetCastTime() > 0) + { + InterruptSpell(CURRENT_MELEE_SPELL); + } + } if (pSpell->GetCastTime() > 0) AddUnitState(UNIT_STATE_CASTING);