fix: mining nodes no longer report invalid target and now open loot after gather

Two bugs fixed:
1. Retry logic (for Classic) re-sent CMSG_GAMEOBJ_USE at 0.15s while the
   gather cast was in-flight, causing SPELL_FAILED_BAD_TARGETS. Now clears
   pendingGameObjectLootRetries_ as soon as SMSG_SPELL_START shows the player
   started a cast (gather accepted).

2. CMSG_LOOT was sent immediately before the gather cast completed, then
   never sent again — so the loot window never opened. Now tracks the last
   interacted GO and sends CMSG_LOOT in handleSpellGo once the gather spell
   completes, matching how the real client behaves.
This commit is contained in:
Kelsi 2026-03-13 04:37:36 -07:00
parent 4272491d56
commit 2c6902d27d
2 changed files with 20 additions and 0 deletions

View file

@ -2778,6 +2778,9 @@ private:
float timer = 0.0f;
};
std::vector<PendingLootOpen> pendingGameObjectLootOpens_;
// Tracks the last GO we sent CMSG_GAMEOBJ_USE to; used in handleSpellGo
// to send CMSG_LOOT after a gather cast (mining/herbalism) completes.
uint64_t lastInteractedGoGuid_ = 0;
uint64_t pendingLootMoneyGuid_ = 0;
uint32_t pendingLootMoneyAmount_ = 0;
float pendingLootMoneyNotifyTimer_ = 0.0f;