[Medium] [Bug] UI reads crafting data from wrong store — equipment effects always empty #364

Closed
opened 2026-06-10 19:28:49 +02:00 by Anexim · 1 comment
Owner

Severity: Medium
File: src/lib/game/hooks/useGameDerived.ts (lines 143-144)

Description:
useGameStore((s) => s.crafting.equipmentInstances) and useGameStore((s) => s.crafting.equippedInstances) are used to read crafting data. But useGameStore is the game coordinator store, which only persists day, hour, incursionStrength, containmentWards, initialized. The crafting field does not exist on useGameStore — it's on useCraftingStore.

This will always return undefined, meaning computeEquipmentEffects receives empty objects, and equipment-based bonuses are always 0 in the UI.

Impact: UI never shows equipment-based stat bonuses (crit chance, attack speed, etc.). Players can't see accurate combat stats.

Fix needed: Change useGameStore to useCraftingStore for reading equipmentInstances and equippedInstances.

**Severity:** Medium **File:** `src/lib/game/hooks/useGameDerived.ts` (lines 143-144) **Description:** `useGameStore((s) => s.crafting.equipmentInstances)` and `useGameStore((s) => s.crafting.equippedInstances)` are used to read crafting data. But `useGameStore` is the **game coordinator store**, which only persists `day, hour, incursionStrength, containmentWards, initialized`. The `crafting` field does not exist on `useGameStore` — it's on `useCraftingStore`. This will always return `undefined`, meaning `computeEquipmentEffects` receives empty objects, and equipment-based bonuses are always 0 in the UI. **Impact:** UI never shows equipment-based stat bonuses (crit chance, attack speed, etc.). Players can't see accurate combat stats. **Fix needed:** Change `useGameStore` to `useCraftingStore` for reading `equipmentInstances` and `equippedInstances`.
Anexim added the ai:todo label 2026-06-10 19:28:49 +02:00
n8n-gitea was assigned by Anexim 2026-06-10 19:28:49 +02:00
Anexim added ai:done and removed ai:todo labels 2026-06-11 11:38:06 +02:00
Author
Owner

Fixed: Changed useGameDerived.ts to read equipmentInstances and equippedInstances from useCraftingStore instead of useGameStore (which doesn't have crafting data).

Fixed: Changed useGameDerived.ts to read equipmentInstances and equippedInstances from useCraftingStore instead of useGameStore (which doesn't have crafting data).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#364