mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-16 09:13:50 +00:00
fix: trade COMPLETE resets state before EXTENDED can populate items/gold
SMSG_TRADE_STATUS(COMPLETE) and SMSG_TRADE_STATUS_EXTENDED arrive in the same packet batch. COMPLETE was calling resetTradeState() which cleared all trade slots and gold BEFORE EXTENDED could write the final data. The trade window showed "7c" (garbage gold) because the gold field read from the wrong offset (slot size was also wrong: 60→52 bytes). Now COMPLETE just sets status to None without full reset, preserving trade state for EXTENDED to populate. The TRADE_CLOSED addon event still fires correctly.
This commit is contained in:
parent
ed7cbccceb
commit
ce54b196e7
1 changed files with 3 additions and 1 deletions
|
|
@ -2102,7 +2102,9 @@ void InventoryHandler::handleTradeStatus(network::Packet& packet) {
|
|||
owner_.addSystemChatMessage("You are already trading.");
|
||||
break;
|
||||
case 7: // TRADE_STATUS_COMPLETE
|
||||
resetTradeState();
|
||||
// Don't reset immediately — TRADE_STATUS_EXTENDED may arrive in the same
|
||||
// packet batch and needs the trade state to store final item/gold data.
|
||||
tradeStatus_ = TradeStatus::None;
|
||||
owner_.addSystemChatMessage("Trade complete.");
|
||||
if (owner_.addonEventCallback_) {
|
||||
owner_.addonEventCallback_("TRADE_CLOSED", {});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue