[High] [Bug] Auto-paused disciplines never auto-resume when mana regenerates + still give full bonuses while paused #380
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 Summary
Two related bugs:
Expected Behavior
Root Cause
Bug 1 (No auto-resume): In
src/lib/game/stores/discipline-slice.ts:210:This unconditionally skips all auto-paused disciplines every tick. No code anywhere in the tick pipeline checks whether mana has been restored and clears
autoPaused. Note: mana regeneration happens BEFORE discipline processing in the tick pipeline (gameStore.ts), so the data is available — the logic just doesn't check it.Bug 2 (Bonuses while paused): In
src/lib/game/effects/discipline-effects.ts:81:This filter only checks
xp > 0, notautoPaused. So paused disciplines still contribute effects.Severity
High — This is an idle game. Having to manually resume disciplines every time mana regenerates defeats the purpose of idle progression. The secondary bug (free bonuses while paused) further breaks game balance.
Files Involved
src/lib/game/stores/discipline-slice.tsif (disc.autoPaused) continueprevents auto-resumesrc/lib/game/stores/discipline-slice.tsactivate()can clearautoPausedbut only via manual UI clicksrc/lib/game/effects/discipline-effects.tsautoPausedfilter — paused disciplines still give bonusessrc/lib/game/stores/gameStore.tsprocessTickafter mana regen — no auto-resume checkFix Direction
processTick, instead ofif (disc.autoPaused) continue, check if mana is now sufficient and if so, clearautoPausedand process normallydiscipline-effects.ts, add&& !disc.autoPausedto the filterStarting investigation of auto-paused disciplines auto-resume bug.
✅ Fixed both sub-bugs:
Auto-resume when mana restored: Replaced
if (disc.autoPaused) continuewith a check that computes the drain cost against current mana. If sufficient, clearsautoPausedand processes the tick normally. Since mana regen runs before discipline processing in the tick pipeline, the updated mana values are already available.No more bonuses while paused: Added
&& !disc.autoPausedto the effect filter indiscipline-effects.tsso auto-paused disciplines no longer contribute stat bonuses, conversion rates, or perk effects.All 1196 tests pass. Pre-commit checks OK.