fix: multiple bug fixes - infinite loop crash, enchant tick handlers, discipline crash, Plasma symbol, desync
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m24s

- #236: Fix Climb the Spire React #185 infinite loop - removed redundant set() in processCombatTick that caused double Zustand writes per tick
- #235: Add enchanting design/prepare/apply tick handlers - extracted to pipelines/enchanting-tick.ts
- #235: Fix startApplying not setting currentAction to 'enchant'
- #243: Guard discipline store against undefined activeIds/processedPerks from corrupted persisted state
- #245: Change Plasma symbol from  (conflicts with Lightning) to 🔴
- #241: Fix combat store maxFloorReached desync - initialize to 0, reset on exitSpireMode
- #239: Fix EffectSelector not rendering when unlockedEffects is empty (fresh game)
- Created pipelines/enchanting-tick.ts to keep gameStore.ts under 400 lines
This commit is contained in:
2026-06-01 12:57:52 +02:00
parent 2539559edc
commit 7dd9ad5b92
11 changed files with 213 additions and 21 deletions
+15
View File
@@ -22,6 +22,7 @@ import { createResetGame, createGatherMana } from './gameActions';
import { createSafeStorage } from '../utils/safe-persist';
import { createStartNewLoop } from './gameLoopActions';
import { buildTickContext, applyTickWrites } from './tick-pipeline';
import { processEnchantingTicks } from './pipelines/enchanting-tick';
import type { TickContext, TickWrites } from './tick-pipeline';
import type { GameCoordinatorState } from './gameStore.types';
@@ -311,6 +312,20 @@ export const useGameStore = create<GameCoordinatorStore>()(
}
}
// Enchanting: Design / Prepare / Application ticks
const enchantingResult = processEnchantingTicks({
ctx, effects, rawMana, addLog,
});
rawMana = enchantingResult.rawMana;
if (enchantingResult.writes) {
if (enchantingResult.writes.combat) {
writes.combat = { ...(writes.combat || {}), ...enchantingResult.writes.combat };
}
if (enchantingResult.writes.attunement) {
writes.attunement = { ...(writes.attunement || {}), ...enchantingResult.writes.attunement };
}
}
// Phase 3: Write
writes.game = { day, hour, incursionStrength };
writes.mana = {