fix: allow inventory reordering while bank is open#1100
Merged
GregHib merged 1 commit intoJul 23, 2026
Conversation
- unlock drag-source (bit 18) and drop-target (bit 21) access mask bits on bank_side so the client initiates drags - swap crossed item ids in 763->763 switch packets; the client reorders before sending, same as interface 149 - deposit from the clicked slot instead of the first matching item Closes GregHib#1060
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.
Closes #1060
Problem
Dragging items to reorder the inventory while the bank (or deposit box) was open did nothing. Additionally, depositing an item when carrying multiples deposited the first matching slot instead of the one clicked (noted in the issue comments).
Cause
Three separate gaps:
bank_side(763). The 634 client requires two access mask conditions for an item drag: drag-depth bits 18-20 != 0 on the source slot and bit 21 on the drop target (Class348_Sub44.method3304/method3302in the deob).bank_side's options only unlocked the deposit/examine bits. The same combination is already what makes the normal inventory tab (Option12 = 17+Drag = 20on 149) and the music playlist work.763->763switch packets. The client reorders its own display before sending, so each item id is paired with the slot it was dropped into. Validation compared the post-swap client state against the pre-swap server state and rejected the packet - leaving the client visually reordered but the server unchanged, which then desynced every later click on those slots. Interface 149 has the same crossing (its handler already swapsfromItemId/toItemIdalongside the ghost-slot-28); 763 needs the id swap without the slot translation, since it uses real slots 0-27.moveToLimit(item.id, ...)removes by id from the first matching slot.Changes
bank.ifaces.toml: addDrag-Source = 17(bit 18, drag-depth 1) andDrag = 20(bit 21) tobank_sideinventory options, making the unlocked mask 2360446 - covers both the bank and deposit box pathsInterfaceSwitchHandler: swap the crossed item ids for763->763switchesBankOpen: handleinterfaceSwap("bank_side:inventory", "bank_side:inventory")withinventory.swap(exact pair, so a future drag-to-deposit onto the bank grid isn't misrouted into an inventory swap)BankDeposit: pass the clicked slot through and remove viaRemoveItem.remove(slot, id, amount)- empties the clicked slot first, then any remainder from the earliest slots; bank-capacity clamping now happens up front viaaddToLimitBankTest: reorder while banked (including onto an empty slot, and the crossed-id packet semantics), verifies both slots are resent to the client after a swap, deposit-after-reorder, and clicked-slot depositsTested in-game: dragging, reordering onto empty slots, and slot-accurate deposits all work with the bank and deposit box open.