From 6617ce0ffdbbcf5431d9967c2dd14365ca6a4d65 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Mon, 24 May 2021 17:55:41 +0200 Subject: [PATCH] Core/Spells: fixed an UI visual glitch that was showing a spell as still being processed when it has been queued up and replaced by a 2nd request --- src/server/game/Entities/Unit/Unit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a3a9a1f2cf..dd343dc9f1 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -14598,6 +14598,10 @@ bool Unit::CanExecutePendingSpellCastRequest(SpellInfo const* spellInfo) const void Unit::RequestSpellCast(PendingSpellCastRequest castRequest, SpellInfo const* spellInfo) { + // We are overriding an already existing spell cast request so inform the client that the old cast is being replaced + if (_pendingSpellCastRequest.has_value()) + CancelPendingCastRequest(); + _pendingSpellCastRequest = castRequest; // If we can process the cast request right now, do it.