mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
fix: guard gather-node CMSG_LOOT dispatch against instant casts and proc spells
handleSpellGo fired lootTarget(lastInteractedGoGuid_) on ANY player spell completion, including instant casts and proc/triggered spells that arrive while the gather cast is still in flight. Save the casting flag before clearing it and only dispatch CMSG_LOOT when wasInTimedCast is true — this ensures only the gather cast completion triggers the post-gather loot send, not unrelated instant spells that also produce SMSG_SPELL_GO.
This commit is contained in:
parent
2c6902d27d
commit
cc2b413e22
1 changed files with 8 additions and 1 deletions
|
|
@ -16292,6 +16292,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;
|
||||
|
||||
casting = false;
|
||||
castIsChannel = false;
|
||||
currentCastSpellId = 0;
|
||||
|
|
@ -16299,7 +16305,8 @@ void GameHandler::handleSpellGo(network::Packet& packet) {
|
|||
|
||||
// If we were gathering a node (mining/herbalism), send CMSG_LOOT now that
|
||||
// the gather cast completed and the server has made the node lootable.
|
||||
if (lastInteractedGoGuid_ != 0) {
|
||||
// Guard with wasInTimedCast to avoid firing on instant casts / procs.
|
||||
if (wasInTimedCast && lastInteractedGoGuid_ != 0) {
|
||||
lootTarget(lastInteractedGoGuid_);
|
||||
lastInteractedGoGuid_ = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue