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
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m19s
This commit is contained in:
@@ -101,8 +101,11 @@ export const useDisciplineStore = create<DisciplineStore>()(
|
||||
|
||||
if (def.manaType === 'raw') {
|
||||
rawMana -= drain;
|
||||
} else {
|
||||
elements[def.manaType].current -= drain;
|
||||
} else if (elements[def.manaType]) {
|
||||
elements[def.manaType] = {
|
||||
...elements[def.manaType],
|
||||
current: elements[def.manaType].current - drain,
|
||||
};
|
||||
}
|
||||
|
||||
newDisciplines[id] = { ...disc, xp: disc.xp + 1 };
|
||||
|
||||
Reference in New Issue
Block a user