mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-04 05:23:46 +01:00
Add migration for broken saves
This commit is contained in:
parent
78104b40ad
commit
965d5c7c20
@ -120,7 +120,7 @@ export const CONSTANTS: {
|
|||||||
LatestUpdate: string;
|
LatestUpdate: string;
|
||||||
} = {
|
} = {
|
||||||
VersionString: "1.6.4",
|
VersionString: "1.6.4",
|
||||||
VersionNumber: 16,
|
VersionNumber: 17,
|
||||||
|
|
||||||
// Speed (in ms) at which the main loop is updated
|
// Speed (in ms) at which the main loop is updated
|
||||||
_idleSpeed: 200,
|
_idleSpeed: 200,
|
||||||
|
@ -414,6 +414,23 @@ function evaluateVersionCompatibility(ver: string | number): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fix bugged NFG accumulation in owned augmentations
|
||||||
|
if (ver < 17) {
|
||||||
|
let ownedNFGs = [...Player.augmentations];
|
||||||
|
ownedNFGs = ownedNFGs.filter((aug) => aug.name === AugmentationNames.NeuroFluxGovernor);
|
||||||
|
const newNFG = new PlayerOwnedAugmentation(AugmentationNames.NeuroFluxGovernor);
|
||||||
|
newNFG.level = 0;
|
||||||
|
|
||||||
|
for (const nfg of ownedNFGs) {
|
||||||
|
newNFG.level += nfg.level;
|
||||||
|
}
|
||||||
|
|
||||||
|
Player.augmentations = [
|
||||||
|
...Player.augmentations.filter((aug) => aug.name !== AugmentationNames.NeuroFluxGovernor),
|
||||||
|
newNFG,
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user