From 57b44d2347c290f84ceb0fea132a7387303d755a Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 18 Mar 2026 01:15:04 -0700 Subject: [PATCH] fix: clear craft queue on spell failure and all cast reset paths craftQueueSpellId_ and craftQueueRemaining_ were already cleared in cancelCast(), stopCasting(), and SMSG_CAST_RESULT failure, but were missing from five other cast-abort paths: - SMSG_SPELL_FAILURE (mid-cast interrupt): queue persisted after combat interruption, risking a ghost re-cast on the next SMSG_SPELL_GO - handleCastFailed() (SMSG_CAST_FAILED): queue persisted if the server rejected a craft before it started - Player login state reset: leftover queue from prior session survived into the new world session - Same-map resurrection (SMSG_NEW_WORLD): queue persisted through spirit-healer resurrection teleport - Regular world transfer (SMSG_NEW_WORLD): queue persisted across zone changes and dungeon portals --- src/game/game_handler.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 59f72641..8fdaf71d 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -3355,6 +3355,8 @@ void GameHandler::handlePacket(network::Packet& packet) { castIsChannel = false; currentCastSpellId = 0; lastInteractedGoGuid_ = 0; + craftQueueSpellId_ = 0; + craftQueueRemaining_ = 0; queuedSpellId_ = 0; queuedSpellTarget_ = 0; if (auto* renderer = core::Application::getInstance().getRenderer()) { @@ -9097,6 +9099,8 @@ void GameHandler::selectCharacter(uint64_t characterGuid) { lastInteractedGoGuid_ = 0; castTimeRemaining = 0.0f; castTimeTotal = 0.0f; + craftQueueSpellId_ = 0; + craftQueueRemaining_ = 0; queuedSpellId_ = 0; queuedSpellTarget_ = 0; playerDead_ = false; @@ -18351,6 +18355,8 @@ void GameHandler::handleCastFailed(network::Packet& packet) { currentCastSpellId = 0; castTimeRemaining = 0.0f; lastInteractedGoGuid_ = 0; + craftQueueSpellId_ = 0; + craftQueueRemaining_ = 0; queuedSpellId_ = 0; queuedSpellTarget_ = 0; @@ -22061,6 +22067,8 @@ void GameHandler::handleNewWorld(network::Packet& packet) { castIsChannel = false; currentCastSpellId = 0; castTimeRemaining = 0.0f; + craftQueueSpellId_ = 0; + craftQueueRemaining_ = 0; queuedSpellId_ = 0; queuedSpellTarget_ = 0; @@ -22121,6 +22129,8 @@ void GameHandler::handleNewWorld(network::Packet& packet) { pendingGameObjectInteractGuid_ = 0; lastInteractedGoGuid_ = 0; castTimeRemaining = 0.0f; + craftQueueSpellId_ = 0; + craftQueueRemaining_ = 0; queuedSpellId_ = 0; queuedSpellTarget_ = 0;