[Low] [Bug] Enchanting: Dual design slot logic error when both slots empty #304

Closed
opened 2026-06-07 17:42:18 +02:00 by Anexim · 2 comments
Owner

Spec: docs/specs/attunements/enchanter/systems/enchanting-spec.md §3.5
Severity: Wrong logic

Problem: src/lib/game/crafting-design.ts:149isSecondDesignSlotAvailable() returns true when both slots are empty (!designProgress && !designProgress2). The spec requires the first slot to be occupied for the second slot to be available. In practice, startDesigningEnchantment always 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:149

**Spec:** docs/specs/attunements/enchanter/systems/enchanting-spec.md §3.5 **Severity:** Wrong logic **Problem:** `src/lib/game/crafting-design.ts:149` — `isSecondDesignSlotAvailable()` returns `true` when both slots are empty (`!designProgress && !designProgress2`). The spec requires the first slot to be occupied for the second slot to be available. In practice, `startDesigningEnchantment` always 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:149`
Anexim added the ai:todo label 2026-06-07 17:42:18 +02:00
n8n-gitea was assigned by Anexim 2026-06-07 17:42:18 +02:00
Anexim added ai:in-progress and removed ai:todo labels 2026-06-08 15:01:56 +02:00
Author
Owner

Starting work on dual design slot logic fix.

Starting work on dual design slot logic fix.
Anexim added ai:done and removed ai:in-progress labels 2026-06-08 15:04:18 +02:00
Author
Owner

Fix applied and pushed. Fixed dual design slot logic to return false when first slot is empty.

Root cause: isSecondDesignSlotAvailable() returned true when 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 true to if (!designProgress) return false.

Tests: 1069 passed (58 files).

**Fix applied and pushed.** Fixed dual design slot logic to return false when first slot is empty. **Root cause:** `isSecondDesignSlotAvailable()` returned `true` when 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 true` to `if (!designProgress) return false`. **Tests:** 1069 passed (58 files).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#304