From 48bcee32b4252d4e04d2978b1cdb290979f74f6a Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Mar 2026 05:12:22 -0700 Subject: [PATCH] fix: match spell ID in handleSpellGo to prevent proc spells triggering gather loot wasInTimedCast checked casting == true but not whether the completing spell was actually the gather cast. A triggered/proc spell (SMSG_SPELL_GO with a different spellId) could arrive while a gather cast is active (casting==true), satisfying the old guard and firing lootTarget prematurely. Require data.spellId == currentCastSpellId so only the spell that started the cast bar triggers the post-gather CMSG_LOOT dispatch. --- src/game/game_handler.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 7e4fd86f..3d46fd31 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -16318,11 +16318,12 @@ void GameHandler::handleSpellGo(network::Packet& packet) { meleeSwingCallback_(); } - // Capture cast state before clearing: SMSG_SPELL_GO for instant casts and - // proc/triggered spells arrives while casting == false (they never go through - // handleSpellStart with castTime > 0). We must NOT send CMSG_LOOT for a - // gather node in those cases — only when a real timed gather cast completes. - const bool wasInTimedCast = casting; + // Capture cast state before clearing. Guard with spellId match so that + // proc/triggered spells (which fire SMSG_SPELL_GO while a gather cast is + // still active and casting == true) do NOT trigger premature CMSG_LOOT. + // Only the spell that originally started the cast bar (currentCastSpellId) + // should count as "gather cast completed". + const bool wasInTimedCast = casting && (data.spellId == currentCastSpellId); casting = false; castIsChannel = false;