Fix BUG 2: Set currentAction to 'study' when starting skill or spell study
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 2m21s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 2m21s
The startStudyingSkill() and startStudyingSpell() functions in skillStore.ts
were setting currentStudyTarget but not updating currentAction in combatStore.
Added useCombatStore.getState().setAction('study') calls to both functions
so the game tick properly processes study progress.
This commit is contained in:
@@ -77,6 +77,8 @@ export interface CombatState {
|
||||
setIsDescending: (descending: boolean) => void;
|
||||
climbDownFloor: () => void;
|
||||
exitSpireMode: () => void;
|
||||
startClimbUp: () => void;
|
||||
startClimbDown: () => void;
|
||||
|
||||
// Golemancy
|
||||
toggleGolem: (golemId: string) => void;
|
||||
@@ -254,6 +256,10 @@ export const useCombatStore = create<CombatState>()(
|
||||
set({ spireMode: false, climbDirection: null, isDescending: false });
|
||||
},
|
||||
|
||||
startClimbUp: () => set({ climbDirection: 'up', currentAction: 'climb' }),
|
||||
|
||||
startClimbDown: () => set({ climbDirection: 'down', currentAction: 'climb' }),
|
||||
|
||||
// Golemancy
|
||||
toggleGolem: (golemId: string) => {
|
||||
set((s) => {
|
||||
|
||||
@@ -6,6 +6,7 @@ import { persist } from 'zustand/middleware';
|
||||
import { SKILLS_DEF, getStudySpeedMultiplier, getStudyCostMultiplier } from '../constants';
|
||||
import type { StudyTarget, SkillUpgradeChoice } from '../types';
|
||||
import { SKILL_EVOLUTION_PATHS, getBaseSkillId } from '../skill-evolution';
|
||||
import { useCombatStore } from './combatStore';
|
||||
|
||||
export interface SkillState {
|
||||
// Skills
|
||||
@@ -131,6 +132,8 @@ export const useSkillStore = create<SkillState>()(
|
||||
},
|
||||
});
|
||||
|
||||
useCombatStore.getState().setAction('study');
|
||||
|
||||
return { started: true, cost: isAlreadyPaid ? 0 : cost };
|
||||
},
|
||||
|
||||
@@ -147,6 +150,8 @@ export const useSkillStore = create<SkillState>()(
|
||||
},
|
||||
});
|
||||
|
||||
useCombatStore.getState().setAction('study');
|
||||
|
||||
// Spell study has no mana cost upfront - cost is paid via study time
|
||||
return { started: true, cost: 0 };
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user