[priority: highest] Fabricator "Craft" button does nothing when crafting materials #176

Closed
opened 2026-05-28 11:39:12 +02:00 by Anexim · 2 comments
Owner

Description

In the Fabricator tab under Crafting, the "Craft" button for material recipes appears enabled when the player has sufficient materials and mana, but clicking it silently does nothing — no material is crafted and no error message is shown.

Root Cause

In src/lib/game/crafting-actions/crafting-material-actions.ts, line 19, the craftMaterial function has a guard check:

const currentAction = useCombatStore.getState().currentAction;
if (currentAction !== 'meditate') return { success: false };

This silently fails when the player is not in "meditate" combat action. The UI's canCraftRecipe check only validates material/mana sufficiency, so the button appears enabled regardless of combat action state, misleading the player.

Affected Files

  • src/lib/game/crafting-actions/crafting-material-actions.ts line 19 — guard gate
  • src/components/game/tabs/CraftingTab/FabricatorSubTab.tsx lines 163–169 — handler dispatch
  • src/components/game/tabs/CraftingTab/MaterialRecipeCard.tsx lines 90–99 — button rendering

Reproduction

  1. Unlock Fabricator attunement
  2. Open Crafting tab → Fabricator sub tab
  3. Gather enough materials and mana for a material recipe
  4. Click "Craft"
  5. Nothing happens — no material crafted, no feedback

Expected Behavior

Material crafting should work regardless of current combat action (it's instant, not a timed action), or the button should show a clear reason why crafting is unavailable.

## Description In the Fabricator tab under Crafting, the "Craft" button for material recipes appears enabled when the player has sufficient materials and mana, but clicking it silently does nothing — no material is crafted and no error message is shown. ## Root Cause In `src/lib/game/crafting-actions/crafting-material-actions.ts`, line 19, the `craftMaterial` function has a guard check: ```typescript const currentAction = useCombatStore.getState().currentAction; if (currentAction !== 'meditate') return { success: false }; ``` This silently fails when the player is not in "meditate" combat action. The UI's `canCraftRecipe` check only validates material/mana sufficiency, so the button appears enabled regardless of combat action state, misleading the player. ## Affected Files - `src/lib/game/crafting-actions/crafting-material-actions.ts` line 19 — guard gate - `src/components/game/tabs/CraftingTab/FabricatorSubTab.tsx` lines 163–169 — handler dispatch - `src/components/game/tabs/CraftingTab/MaterialRecipeCard.tsx` lines 90–99 — button rendering ## Reproduction 1. Unlock Fabricator attunement 2. Open Crafting tab → Fabricator sub tab 3. Gather enough materials and mana for a material recipe 4. Click "Craft" 5. Nothing happens — no material crafted, no feedback ## Expected Behavior Material crafting should work regardless of current combat action (it's instant, not a timed action), or the button should show a clear reason why crafting is unavailable.
Anexim added the ai:todo label 2026-05-28 11:39:12 +02:00
n8n-gitea was assigned by Anexim 2026-05-28 11:39:12 +02:00
Author
Owner

Starting investigation of the Fabricator "Craft" button bug. Issue is in crafting-material-actions.ts - the craftMaterial function has a guard that silently fails when combat action is not 'meditate'. Material crafting is instant and shouldn't require meditate state. Will fix the guard and ensure proper UI feedback.

Starting investigation of the Fabricator "Craft" button bug. Issue is in crafting-material-actions.ts - the `craftMaterial` function has a guard that silently fails when combat action is not 'meditate'. Material crafting is instant and shouldn't require meditate state. Will fix the guard and ensure proper UI feedback.
Author
Owner

Fixed. Removed the currentAction !== 'meditate' guard from craftMaterial() in crafting-material-actions.ts. Material crafting is an instant action (not a timed action like equipment crafting), so it should work regardless of the player's current combat state.

Changes:

  • Removed useCombatStore import (no longer needed)
  • Removed the guard check that silently returned { success: false } when not meditating
  • File went from 42 → 39 lines

All 916 tests pass. Committed and pushed as aba1265.

Fixed. Removed the `currentAction !== 'meditate'` guard from `craftMaterial()` in `crafting-material-actions.ts`. Material crafting is an instant action (not a timed action like equipment crafting), so it should work regardless of the player's current combat state. Changes: - Removed `useCombatStore` import (no longer needed) - Removed the guard check that silently returned `{ success: false }` when not meditating - File went from 42 → 39 lines All 916 tests pass. Committed and pushed as `aba1265`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#176