Reasonable AH stack sizes (category rules + realistic breakpoints)#19
Merged
Conversation
getStackCount now takes the ItemTemplate and applies player-like stacking instead
of uniform random. Always-single categories (glyphs, recipes, quest/container/key,
and cut gems via GemProperties!=0) return 1 regardless of template stackable; raw
gems and commodities get weighted human breakpoints {1,5,10,20,full} clamped to the
stackable ceiling, never a random 7/13. O(1), no DB/alloc; existing quality/config
caps and the optional DivisibleStacks mode are preserved.
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.
Replaces the uniform-random stack assignment (
getStackCount, which literally had a// TODO: This is not goodcomment) with player-like stacking.Change
getStackCount(config, max, prototype)now:stackable: glyphs (16), recipes (9), quest (12), containers (1), keys (13), and cut gems (class 3 withGemProperties != 0). Raw/prospected gems (GemProperties == 0) stack like materials.{1, 5, 10, 20, full}clamped to the stackable ceiling (~30% full stack, ~20% single, ~50% a clean mid) — never a random 7 or 13.Notes
switch+ oneurand, no DB lookup, no heap allocation (fixed 3-element local array).GetMaxStack,GetMaxStackSize) and the optionalDivisibleStacksmode are preserved; only the number chosen within the ceiling changes.prototypeis NULL-checked before the stack branch inSell, so no nullptr risk.Validation
CI
-Werrorbuild is the compile gate. Behaviour to confirm on TEST realm: glyphs/recipes/cut gems list as 1; cloth/ore/herbs/potions list as clean 5/10/20/full stacks.