Bug: Cannot reactivate raw-mana disciplines after deactivating them #214
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
When a player deactivates a discipline (e.g. Raw Mana Mastery) and tries to reactivate it by clicking the button in the Disciplines tab, the reactivation silently fails. The discipline remains inactive with no error message.
Root Cause
Two-part bug:
UI layer (
src/components/game/tabs/DisciplinesTab.tsxline 92):rawManais read from the mana store and included in theuseCallbackdependency array, but is never passed toactivate():API layer (
src/lib/game/stores/discipline-slice.ts): Theactivatemethod's type signature doesn't includerawManain thegameStateparameter:When
gameStateis provided butrawManais undefined,canProceedDiscipline()indiscipline-math.tsevaluates(undefined || 0) >= drain→false, silently blocking reactivation.Reproduction
Fix Required
rawManato theactivatemethod'sgameStatetype indiscipline-slice.tsrawManafromDisciplinesTab.tsx:activate(id, { elements, signedPacts, rawMana })DisciplineDebugSection.tsxwhich has the same issueExisting Test
The test in
discipline-reactivate-bug.test.tspasses because it directly passesrawMana: 1000in the gameState, bypassing the broken UI layer. The test should be updated to also test the UI code path.