fix: clone nested element objects in discipline-slice processTick to avoid bypassing Zustand reactivity
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m19s

This commit is contained in:
2026-05-19 12:51:41 +02:00
parent 213425e6c9
commit ebcaab62bf
3 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
# Circular Dependencies # Circular Dependencies
Generated: 2026-05-19T10:06:50.403Z Generated: 2026-05-19T10:35:03.017Z
Found: 3 circular chain(s) — these MUST be fixed before modifying involved files. Found: 3 circular chain(s) — these MUST be fixed before modifying involved files.
1. Processed 121 files (1.3s) (28 warnings) 1. Processed 121 files (1.2s) (4 warnings)
2. 1) data/equipment/index.ts > data/equipment/utils.ts 2. 1) data/equipment/index.ts > data/equipment/utils.ts
3. 2) data/golems/index.ts > data/golems/utils.ts 3. 2) data/golems/index.ts > data/golems/utils.ts
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"_meta": { "_meta": {
"generated": "2026-05-19T10:06:48.891Z", "generated": "2026-05-19T10:35:01.630Z",
"description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.", "description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.",
"usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry." "usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry."
}, },
+5 -2
View File
@@ -101,8 +101,11 @@ export const useDisciplineStore = create<DisciplineStore>()(
if (def.manaType === 'raw') { if (def.manaType === 'raw') {
rawMana -= drain; rawMana -= drain;
} else { } else if (elements[def.manaType]) {
elements[def.manaType].current -= drain; elements[def.manaType] = {
...elements[def.manaType],
current: elements[def.manaType].current - drain,
};
} }
newDisciplines[id] = { ...disc, xp: disc.xp + 1 }; newDisciplines[id] = { ...disc, xp: disc.xp + 1 };