Repository navigation
Fix trade picker missing enchanted/brewed items and Ready cancelling trades - #8
Merged
absol89 merged 2 commits intoOct 7, 2026
Conversation
Enchanting, renaming and brewing change items without the incremental inventory events the server copy relies on, so those items were missing from the trade picker and the client's Ready check cancelled trades whose offer no longer matched the live inventory. The client now sends its live inventory when a trade starts and before each Ready, and the server replaces its copy and drops offered items the snapshot no longer covers. Outdated offers unready instead of cancelling. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SSW5HGXzi9kAVm4zdsSaid
Inventory removals passed a freshly built extra data list to RemoveItem. It matches none of the inventory's stored lists, so trading away an enchanted, renamed or poisoned item could leave it with the sender and take a plain copy (or nothing) instead. Removals now find the stored extra data list that describes the entry and remove that one. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SSW5HGXzi9kAVm4zdsSaid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by *absol89 · project thread
Before: in the playtest, items enchanted and renamed during the session ("AAA ...") and freshly brewed potions were missing from the trade picker, and clicking Ready cancelled the trade. Trading away an enchanted, renamed or poisoned item could also leave it with the sender while a plain copy (or nothing) was removed.
After: the picker lists the player's actual inventory, so those items can be offered, and Ready keeps the trade open. If an offer is out of date, Ready now unreadies the player instead of cancelling the trade. The sender loses the exact item that was traded.
The picker and server validation used the server's copy of the player's inventory. That copy is built at join and then updated through incremental inventory events, and enchanting, renaming and brewing can change items without firing those events. The copy then no longer matched the game. The client-side Ready check compared the live inventory with that outdated copy and cancelled on any mismatch.
How:
TradeInventorySyncRequest. The client sends its liveGetInventory()when a trade starts and before each Ready, and the server replaces its copy for that player.KeepCoveredTradeOffer), and both players are unreadied.AddOrRemoveItemused to pass a freshly built extra data list toRemoveItemfor removals. Removals now pass the inventory's own stored list that matches the entry (FindExtraDataForItem), and only rebuild one, with a warning, when no stored list matches.Verification: I built the encoding library and
Code/testswith g++ on Linux. All 15 test cases pass, including new ones for offer pruning and the sync message round trip. The client and server still need CI and playtest step 11 inPLAYER_TRADING_POTIONS.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01SSW5HGXzi9kAVm4zdsSaid