[priority: high] Disciplines not reset when restarting the loop #187
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: Disciplines persist through loop restart instead of being reset
Description
When the loop ends and the player starts a new loop (via Insight/prestige), disciplines from the previous loop are NOT reset. They retain their XP, active state, and processed perks.
Root Cause Analysis
In
gameLoopActions.ts→createStartNewLoop():The discipline store (
useDisciplineStore) is NEVER reset. It persists via localStorage (it usespersistmiddleware withname: 'mana-loop-discipline-store'), so disciplines from the previous loop carry over.Affected Files
src/lib/game/stores/gameLoopActions.ts—createStartNewLoopfunctionsrc/lib/game/stores/discipline-slice.ts— discipline store (needs aresetDisciplinesaction)Steps to Reproduce
Expected Behavior
Suggested Fix Direction
resetDisciplines()action todiscipline-slice.tscreateStartNewLoopbefore resetting other storesFix applied for issue #187: Disciplines not reset when restarting the loop
Changes:
src/lib/game/stores/discipline-slice.ts— AddedresetDisciplines()action toDisciplineStoreActionsinterface and implementation. Resets all disciplines to empty, clears active resets, concurrent limit, total XP, and processed perks.src/lib/game/stores/gameLoopActions.ts— ImporteduseDisciplineStoreand addeduseDisciplineStore.getState().resetDisciplines()call increateStartNewLoop(), placed afteruseManaStore.getState().resetMana(pu)and before combat reset.Verification: