🐛 TRANSFERENCE MANA FLOW: Discipline always shows as locked despite transference being unlocked at start #169
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
The "Transference Mana Flow" discipline appears permanently locked even though the player has transference mana unlocked from the start.
Root Cause
checkDisciplinePrerequisites()insrc/lib/game/utils/discipline-math.ts:119-155handles therequiresfield by searching for a matching discipline ID first, then falling back to treating it as a mana type name. When it encounters'transference':ALL_DISCIPLINESfor a discipline withid === 'transference'— none exists (the actual ID is'regen-transference')elsebranch and unconditionally adds"transference mana"tomissingPrereqsMeanwhile, the UI's separate
sourceManaTypescheck does correctly checkelements['transference']?.unlockedand would return no missing mana — butisLockedfromcheckDisciplinePrerequisitesis alreadytrue, soeffectiveIsLockedis alwaystrue.Fix
checkDisciplinePrerequisitesneeds to either:elementsstate as a parameter to verify mana type unlocksrequiresfield and verify accordinglyFiles
src/lib/game/utils/discipline-math.ts:119-155(the buggy function)src/lib/game/data/disciplines/elemental-regen.ts:71-96(discipline definition withrequires: ['transference'])src/components/game/tabs/DisciplinesTab.tsx:~263(uses!prereqCheck.canProceed)src/lib/game/stores/discipline-slice.ts:82(also calls this function inactivate())Fixed in commit
8cebea9. Addedelementsparameter tocheckDisciplinePrerequisitesso mana type requirements (liketransference) are verified against the player's unlocked elements. Updated callers in DisciplinesTab.tsx and discipline-slice.ts. Added 4 new tests.