[Critical] [Bug] enterSpireMode crashes with ReferenceError: s is not defined #335
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:
enterSpireModecrashes withReferenceError: s is not definedSteps to reproduce
Expected
Spire Mode activates, combat UI appears, currentFloor is shown.
Actual
Console error:
ReferenceError: s is not definedatenterSpireMode. The button does nothing — Spire Mode stays OFF. The game also unexpectedly advances to Day 2.Root cause
In
src/lib/game/stores/combat-descent-actions.tsline ~275, thecreateEnterSpireModefunction referencess.golemancybutsis not defined in scope. The function receivesgetandsetparameters but the state variablesis not declared.Should use
get().golemancyinstead ofs.golemancy.Store
useCombatStore→combat-descent-actions.ts→createEnterSpireModeFix Applied
File:
src/lib/game/stores/combat-descent-actions.tsChange: On line 275, replaced
s.golemancy?.golemDesignswithget().golemancy?.golemDesignsinside theset()call withincreateEnterSpireMode.Root cause: The
createEnterSpireModefunction receivesgetandsetparameters but never declares a localsvariable (unlike other functions in the file that doconst s = get()). Theset()callback referenceds.golemancywhich was undefined, causing aReferenceError: s is not defined.Verification: