fix: combatStore.ts persist partialize saves wrong field for activeSpell #27
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?
Severity: Critical
File:
src/lib/game/stores/combatStore.ts(line 273)Problem: The
partializefunction includesactiveSpell: state.activeAction— it savescurrentAction(e.g.,'meditate','climb') into theactiveSpellpersisted key. On reload,activeSpellwill be set to an action string like'meditate'instead of a spell ID like'manaBolt', which will break spell casting.Impact: After page reload, the active spell will be corrupted to an action name. Spell casting will fail because
SPELLS_DEF['meditate']is undefined.Fix: Change to
activeSpell: state.activeSpell.Starting work on combatStore.ts persist partialize saves wrong field for activeSpell
Fixed: Changed
activeSpell: state.activeActiontoactiveSpell: state.activeSpellin combatStore.ts partialize