[Medium] [Bug] UI reads crafting data from wrong store — equipment effects always empty #364
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: Medium
File:
src/lib/game/hooks/useGameDerived.ts(lines 143-144)Description:
useGameStore((s) => s.crafting.equipmentInstances)anduseGameStore((s) => s.crafting.equippedInstances)are used to read crafting data. ButuseGameStoreis the game coordinator store, which only persistsday, hour, incursionStrength, containmentWards, initialized. Thecraftingfield does not exist onuseGameStore— it's onuseCraftingStore.This will always return
undefined, meaningcomputeEquipmentEffectsreceives 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
useGameStoretouseCraftingStorefor readingequipmentInstancesandequippedInstances.Fixed: Changed useGameDerived.ts to read equipmentInstances and equippedInstances from useCraftingStore instead of useGameStore (which doesn't have crafting data).