From 744cbf121f7d731ad54ce03552b8af1bf24e24b7 Mon Sep 17 00:00:00 2001 From: Hikari Date: Wed, 18 Mar 2026 13:26:18 -0700 Subject: [PATCH] fix: preserve autoQuest and autoBoss settings across prestige (#66) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - `buildPostPrestigeState` was constructing the post-prestige `GameState` from `initialGameState`, which hard-codes `autoQuest` and `autoBoss` to `false` - Neither flag was being carried forward, so both automation settings silently reset after every prestige - Now both values are explicitly preserved from `currentState` (with `?? false` fallback for safety) Closes #51 ✨ This issue was created with help from Hikari~ 🌸 Reviewed-on: https://git.nhcarrigan.com/nhcarrigan/elysium/pulls/66 Co-authored-by: Hikari Co-committed-by: Hikari --- apps/api/src/services/prestige.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/api/src/services/prestige.ts b/apps/api/src/services/prestige.ts index 8f40a35..3cd69af 100644 --- a/apps/api/src/services/prestige.ts +++ b/apps/api/src/services/prestige.ts @@ -5,6 +5,7 @@ * @author Naomi Carrigan */ /* eslint-disable max-lines-per-function -- buildPostPrestigeState requires constructing a large composite state object */ +/* eslint-disable complexity -- buildPostPrestigeState has many optional fields that each add a branch point */ import { initialGameState } from "../data/initialState.js"; import { defaultPrestigeUpgrades } from "../data/prestigeUpgrades.js"; import type { @@ -239,11 +240,20 @@ const buildPostPrestigeState = ( const prestigeState: GameState = { ...freshState, + // Achievements are permanent — earned achievements survive all prestiges achievements: currentState.achievements, + + /* + * Preserve automation preferences across prestige — the player explicitly + * opted into these settings and would not expect them to silently reset. + */ + autoBoss: currentState.autoBoss ?? false, + + autoQuest: currentState.autoQuest ?? false, // Boss statuses reset for gameplay, but first-kill claimed flag is preserved - bosses: bossesWithBountyClaimed, - lastTickAt: Date.now(), + bosses: bossesWithBountyClaimed, + lastTickAt: Date.now(), /* * Fold current-run totals into lifetime stats so the GameState reflects