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.
This commit is contained in:
Kelsi 2026-03-13 05:12:22 -07:00
parent f44defec38
commit 48bcee32b4

View file

@ -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;