mirror of
https://github.com/IvarK/AntimatterDimensionsSourceCode.git
synced 2024-11-10 06:02:13 +00:00
Fix bug with constants after game completion
Migrate saves with bugged constants
This commit is contained in:
parent
2d4fddd1b0
commit
561c8cfc9c
@ -56,6 +56,7 @@ export const NG = {
|
||||
// which could lead to some edge cases where it starts when it shouldn't (ie before it's unlocked)
|
||||
// It's easier to do something like this to avoid it entirely.
|
||||
const automatorConstants = JSON.stringify(player.reality.automator.constants);
|
||||
const automatorConstantSort = JSON.stringify(player.reality.automator.constantSortOrder);
|
||||
const automatorScripts = JSON.stringify(player.reality.automator.scripts);
|
||||
const fullCompletions = player.records.fullGameCompletions;
|
||||
const fullTimePlayed = player.records.previousRunRealTime + player.records.realTimePlayed;
|
||||
@ -72,6 +73,7 @@ export const NG = {
|
||||
player.secretUnlocks = secretUnlocks;
|
||||
player.secretAchievementBits = JSON.parse(secretAchievements);
|
||||
player.reality.automator.constants = JSON.parse(automatorConstants);
|
||||
player.reality.automator.constantSortOrder = JSON.parse(automatorConstantSort);
|
||||
player.reality.automator.scripts = JSON.parse(automatorScripts);
|
||||
player.records.fullGameCompletions = fullCompletions;
|
||||
player.records.previousRunRealTime = fullTimePlayed;
|
||||
|
@ -359,7 +359,7 @@ window.player = {
|
||||
previousRuns: {}
|
||||
},
|
||||
IPMultPurchases: 0,
|
||||
version: 23,
|
||||
version: 24,
|
||||
infinityPower: DC.D1,
|
||||
postC4Tier: 0,
|
||||
eternityPoints: DC.D0,
|
||||
|
@ -404,6 +404,13 @@ export const migrations = {
|
||||
}
|
||||
}
|
||||
},
|
||||
24: player => {
|
||||
// Automator constants didn't copy over properly across new games - retroactively fix bugged saves as well
|
||||
const definedConstants = Object.keys(player.reality.automator.constants);
|
||||
if (definedConstants.length !== player.reality.automator.constantSortOrder.length) {
|
||||
player.reality.automator.constantSortOrder = [...definedConstants];
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
normalizeTimespans(player) {
|
||||
|
Loading…
Reference in New Issue
Block a user