[priority: 3] cancelDesign logic inverted — cancels wrong design slot #78
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: 3 — Medium
File:
src/lib/game/stores/craftingStore.tsandsrc/lib/game/crafting-actions/design-actions.tsDescription:
The condition cancels
designProgress2only whendesignProgressis null, but the else branch cancelsdesignProgresseven whendesignProgress2exists. This means canceling when both slots are active cancels the first slot, leaving the second orphaned.Fix: Always cancel
designProgressfirst; only canceldesignProgress2whendesignProgressis already null.Starting work on cancelDesign logic fix.
✅ Fixed. Cancel logic now always cancels
designProgress(slot 1) first. Only cancelsdesignProgress2(slot 2) whendesignProgressis already null. Previously the inverted condition could cancel the wrong slot when both were active. Regression tests added.