"Can't resume practicing discipline when stopped" #230
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?
Description: After deactivating a discipline, clicking "Start Practicing" does not re-activate the discipline. The button changes but the discipline remains paused/inactive.
Root Cause:
The
activatemethod indiscipline-slice.tshas a guard incanProceedDiscipline()that checks if the player has sufficient mana to cover the discipline's drain:When re-activating a discipline with
gameState.elementsbut norawManaproperty (which is the case fromDisciplinesTab.tsx— onlyelementsandsignedPactsare passed),canProceedDisciplinechecksgameState.rawManawhich isundefined, fails the drain check, and silently returns without activating.From
DisciplinesTab.tsx:The
rawManavariable is available in scope but NOT passed in thegameStateobject. This is a mismatch — theactivatemethod needsrawManafor raw-type disciplines, but the UI doesn't pass it.Files involved:
src/lib/game/stores/discipline-slice.ts—activatemethod, mana drain checksrc/components/game/tabs/DisciplinesTab.tsx—handleToggledoesn't passrawManasrc/lib/game/utils/discipline-math.ts—canProceedDisciplinechecks manaFix needed: Pass
rawManafromDisciplinesTab.tsxinto thegameStateparameter ofactivate().AGENTS.md rules: All fixes must keep files under 400 lines.
Starting work on the discipline re-activation fix. The issue is that DisciplinesTab.tsx doesn't pass rawMana to the activate() call.
Fixed discipline re-activation by passing rawMana in the gameState object to activate() in DisciplinesTab.tsx. Changed
activate(id, { elements, signedPacts })toactivate(id, { elements, signedPacts, rawMana }). All 70 discipline tests pass.