fix: BUG 4 - Add starting equipment to craftingStore initial state
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 2m9s

This commit is contained in:
2026-05-07 14:07:23 +02:00
parent be918d1bab
commit 58aa74486e
+8 -6
View File
@@ -92,7 +92,9 @@ export type CraftingStore = CraftingState & CraftingActions;
export const useCraftingStore = create<CraftingStore>()(
persist(
(set, get) => ({
(set, get) => {
const startingEquipment = createStartingEquipment();
return {
// Initial state
designProgress: null,
designProgress2: null,
@@ -101,8 +103,7 @@ export const useCraftingStore = create<CraftingStore>()(
equipmentCraftingProgress: null,
enchantmentDesigns: [],
unlockedEffects: [],
equipmentInstances: {},
equippedInstances: {},
...startingEquipment,
lootInventory: {
materials: {},
blueprints: [],
@@ -252,7 +253,7 @@ export const useCraftingStore = create<CraftingStore>()(
// Check if we can start crafting
const check = CraftingEquipment.canStartEquipmentCrafting(
blueprintId,
bluePrintId,
state.lootInventory.blueprints.includes(blueprintId),
state.lootInventory.materials,
rawMana,
@@ -263,7 +264,7 @@ export const useCraftingStore = create<CraftingStore>()(
// Initialize crafting
const result = CraftingEquipment.initializeEquipmentCrafting(
blueprintId,
bluePrintId,
state.lootInventory.materials,
rawMana
);
@@ -350,7 +351,8 @@ export const useCraftingStore = create<CraftingStore>()(
};
});
},
}),
};
},
{
name: 'mana-loop-crafting',
partialize: (state) => ({