[Low] [Bug] Enchanting: Dual design slot logic error when both slots empty #304
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?
Spec: docs/specs/attunements/enchanter/systems/enchanting-spec.md §3.5
Severity: Wrong logic
Problem:
src/lib/game/crafting-design.ts:149—isSecondDesignSlotAvailable()returnstruewhen both slots are empty (!designProgress && !designProgress2). The spec requires the first slot to be occupied for the second slot to be available. In practice,startDesigningEnchantmentalways fills slot 1 first, so this may not manifest as a user-visible bug, but the utility function is incorrect.File:
src/lib/game/crafting-design.ts:149Starting work on dual design slot logic fix.
Fix applied and pushed. Fixed dual design slot logic to return false when first slot is empty.
Root cause:
isSecondDesignSlotAvailable()returnedtruewhen both slots were empty. Spec §3.5 requires the first slot to be occupied for the second slot to be available.Fix: Changed first condition from
if (!designProgress && !designProgress2) return truetoif (!designProgress) return false.Tests: 1069 passed (58 files).