Skip to content

Use the real main bank size instead of a hardcoded one - #23

Open
uga wants to merge 1 commit into
Thaoky:developmentfrom
uga:fix/real-bank-size
Open

Use the real main bank size instead of a hardcoded one#23
uga wants to merge 1 commit into
Thaoky:developmentfrom
uga:fix/real-bank-size

Conversation

@uga

@uga uga commented Aug 1, 2026

Copy link
Copy Markdown

Summary

One fix in DataStore_Containers. Verified in game on Classic Era and TBC Anniversary.


Use the real main bank size instead of a hardcoded one

NUM_MAIN_SLOTS was hardcoded to 28. The main bank holds 24 slots on Classic Era and 28 from TBC onwards, so on Classic Era four slots that do not exist were scanned and drawn.

It now reads NUM_BANKGENERIC_SLOTS, falling back to 28, and stores the size on the character. Storing it matters for an account holding alts scanned on different versions of the game: without it, a Classic Era alt viewed from a TBC client would be drawn with four phantom slots, and the reverse would truncate.

GetPlayerBankInfo() answers with the stored size, and a new GetPlayerBankSize() exposes it for the UI.


Applicability

Fix Classic Era TBC Anniversary
Real bank size yes, the bank was drawn with four slots too many yes, the size is now stored so alts from other versions display correctly

The bank panel change is in the Altoholic_Cata PR.


Related PRs

This is one change set spread over the repos it touches. Account sharing needs the first two together; the others are independent of each other.

The main bank holds 24 slots on Classic Era and 28 from TBC onwards, but four
different places assumed a fixed value, and none of them agreed:

- bagSizes[MainBankSlots] was "hasVoidBank and 28 or 98". hasVoidBank is only
  true between 5.3 and 11.2, so every classic version below MoP fell through
  to 98, the size of an 11.2 bank tab, and the grid never trimmed its last row
- the containers pane passed a literal 28 to UpdateBagIndices(), so it laid out
  three rows of 12 whatever the character actually has
- the backpack tooltip said 16 and the bank tooltip said 28, both literals,
  which is why the tooltip disagreed with the grid next to it
- PlayerBank scanned 28 main slots regardless

The size is now taken from NUM_BANKGENERIC_SLOTS, and stored per character on
scan so an alt scanned on another version of the game keeps its own size
rather than borrowing the one of the running client. GetPlayerBankSize()
exposes it, and the containers pane routes the bank through it for the grid,
the row layout and the tooltip alike. The backpack tooltip now reads the
scanned container size, so it matches the 20 slots shown on the right.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant