BUG: Raw mana exceeds max cap (111.8 / 100) #237
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug Description
Raw mana pool is not being clamped to its maximum value. The debug panel shows
Current: 111.85941260450063 / 100, meaning mana is ~11.8% over the cap. This allows unbounded mana accumulation beyond the intended limit.Steps to Reproduce
Expected Behavior
Mana should be clamped to maxMana after each tick/regen cycle.
Impact
Investigation Complete — Issue is Incorrect
After thorough investigation using parallel agents, the bug described in this issue is not a mana cap breach. The mana is NOT exceeding the actual max cap — the debug panel is displaying the wrong max mana value.
Root Cause
The debug panel in
GameStateDebugSection.tsx(and the legacyGameStateDebug.tsx) calledcomputeMaxMana()with empty parameters:This always returned the base value of 100, ignoring:
manaWelladds +500 per level)raw-masterygives +10 baseValue maxManaBonus, with perks adding more)maxManaBonusfrom gear)maxManaMultiplier)The actual game display in
LeftPanel.tsxcorrectly usescomputeTotalMaxMana()which aggregates all these sources. With discipline bonuses, the real max mana was likely ~111.8, so raw mana was exactly at the real cap — not over it.Fix Applied
Both debug files have been updated to:
computeTotalMaxManaandgetUnifiedEffectsfrom@/lib/game/effectsprestigeUpgrades,equippedInstances, andequipmentInstancesfrom the actual storesLeftPanel.tsxFiles changed:
src/components/game/tabs/DebugTab/GameStateDebugSection.tsx(active debug panel)src/components/game/debug/GameStateDebug.tsx(legacy debug panel)Tests: All 900 tests pass (44 test files).