mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-03-08 11:29:19 +01:00
Save migration for old contract names
Rename old "HammingCodes: Integer to encoded Binary" contracts to "HammingCodes: Integer to Encoded Binary" on file load if the save is old.
This commit is contained in:
@ -118,7 +118,7 @@ export const CONSTANTS: {
|
||||
LatestUpdate: string;
|
||||
} = {
|
||||
VersionString: "1.6.4",
|
||||
VersionNumber: 15,
|
||||
VersionNumber: 16,
|
||||
|
||||
// Speed (in ms) at which the main loop is updated
|
||||
_idleSpeed: 200,
|
||||
|
@ -398,6 +398,19 @@ function evaluateVersionCompatibility(ver: string | number): void {
|
||||
if (ver < 15) {
|
||||
(Settings as any).EditorTheme = { ...defaultMonacoTheme };
|
||||
}
|
||||
//Fix contract names
|
||||
if (ver < 16) {
|
||||
//Iterate over all contracts on all servers
|
||||
for (const server of GetAllServers()) {
|
||||
for (const contract of server.contracts) {
|
||||
//Rename old "HammingCodes: Integer to encoded Binary" contracts
|
||||
//to "HammingCodes: Integer to Encoded Binary"
|
||||
if (contract.type == "HammingCodes: Integer to encoded Binary") {
|
||||
contract.type = "HammingCodes: Integer to Encoded Binary";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user