generated from nhcarrigan/template
fix: preserve achievements across prestige
Fixes #38. buildPostPrestigeState was using structuredClone(defaultAchievements) via the freshState, which reset all achievements on every prestige. Achievements are now carried forward from currentState.achievements instead, ensuring unlocked achievements are never lost across prestige resets.
This commit is contained in:
@@ -225,7 +225,9 @@ const buildPostPrestigeState = (
|
||||
|
||||
const prestigeState: GameState = {
|
||||
...freshState,
|
||||
lastTickAt: Date.now(),
|
||||
// Achievements are permanent — earned achievements survive all prestiges
|
||||
achievements: currentState.achievements,
|
||||
lastTickAt: Date.now(),
|
||||
|
||||
/*
|
||||
* Fold current-run totals into lifetime stats so the GameState reflects
|
||||
|
||||
Reference in New Issue
Block a user