mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-05 15:17:48 +02:00
Add migration for broken saves
This commit is contained in:
@@ -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,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user