Repository navigation
Remove the unreachable reagent bank move and dead bank read branches (#1358) - #1371
Merged
Merged
Conversation
…1358) No bank view on any client can reach the REAGENT movement flow, and no supported client has a reagent bank to move items into. - Retail and WoW: Forever: addon.isRetail is true, so GetMovementFlow's reagentBank was nil and its check never passed. - Classic Era, The Burning Crusade Anniversary and Mists of Pandaria Classic: Enum.BagIndex still lists Reagentbank (-3), but every writer of a bank's bankTab on those clients sets the main bank (-1) or 99 (bags/{classic,era}/bank.lua, bags/bank.lua SwitchToGroup and SwitchToBankAndWipe, next/bank.lua, data/refresh.lua). The tab paths that set any other value (frames/bankslots.lua, BetterBags Next's tab mode) load or run on retail only. Blizzard's source for each of the five clients has no reagent bank frame or API (ReagentBankFrame, DepositReagentBank, IsReagentBankUnlocked), and the Classic bank has a single panel. Changes: - util/movementflow.lua: remove the reagentBank local and the branch that returned MOVEMENT_FLOW.REAGENT. - core/constants.lua: remove MOVEMENT_FLOW.REAGENT, which nothing else reads. - frames/section.lua: MoveItems no longer passes UseContainerItem a fifth argument. It was always false, which is the argument's default and what Blizzard's bag code passes on every client. - data/items.lua: items:BankBags is reduced to its two live paths (retail: every character and Warbank tab; Classic: the bank, its bags and -3). The `not addon.isRetail` check inside `if addon.isRetail`, the `elseif blizzardTab and addon.isRetail` branch and the Warbank group branch inside the non-retail branch could never run: #997 widened the first condition from `GetShowBankTabs() and isRetail` to `isRetail`, and #1171 moved the code into BankBags unchanged. The bags read and the bagid marked are the same as before. Tests, written first: - spec/movementflow_spec.lua: the made-up REAGENT = 5 / bankTab = 5 test is replaced with Classic's real values. A bank on Reagentbank (-3) moves to the bank (failed before: it returned the reagent flow). - spec/frames/section_spec.lua: MoveItems calls UseContainerItem with four arguments for bank and Warbank moves (failed before: five). - spec/items_spec.lua: BankBags reads every tab on retail with a Warbank tab shown, and the bank, its bags and -3 on Classic with a Warbank group active, marking the character bank. These cover the removed branches' cases and pass before and after, since those branches never ran. Docs: patterns-state.md records that no supported client has a reagent bank and why no flow names one. help.md's list of unfixed bugs drops this one. util/README.md's MOVEMENT_FLOW table now matches core/constants.lua. 8172 tests pass under Lua 5.1; luacheck is clean. Not checked in game: the change removes code that never ran.
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 #1358.
Summary
No bank view on any client can reach
MovementFlow:GetMovementFlow'sREAGENTbranch, and no supported client has a reagent bank.addon.isRetailis true, soreagentBankwas nil.Enum.BagIndex.Reagentbankis -3, but everybankTabwriter on these clients sets -1 or 99. Blizzard's source for each client has no reagent bank frame or API, and the Classic bank has one panel.Changes
util/movementflow.lua,core/constants.lua: remove theREAGENTbranch andMOVEMENT_FLOW.REAGENT.frames/section.lua:MoveItemsdropsUseContainerItem's fifth argument. The argument was always false, which is its default and what Blizzard's bag code passes on every client.data/items.lua:items:BankBagsis reduced to its two live paths. Three branches could never run since Fix bank tab item disappearances and unassigned category leakage #997 widened the first condition toaddon.isRetail. The bags read and thebagidmarked are unchanged.patterns-state.md(no reagent bank on any client),help.md(removed from the list of unfixed bugs),util/README.md(theMOVEMENT_FLOWtable now matchescore/constants.lua).Tests
Written first:
spec/movementflow_spec.lua: a Classic bank on -3 moves to the bank. This failed before the fix.spec/frames/section_spec.lua:UseContainerItemreceives four arguments. This failed before the fix (five).spec/items_spec.lua:BankBagson retail with a Warbank tab shown, and on Classic with a Warbank group active. These pass before and after, because the removed branches never ran.8172 tests pass under Lua 5.1, and luacheck is clean. Not checked in game: the change removes code that never ran.