Merge pull request #3537 from Undeemiss/breaking-contract-capitalization

CODINGCONTRACT: FIX #3484 BREAKING Fixed capitalization in contract name
This commit is contained in:
hydroflame 2022-04-26 11:15:42 -04:00 committed by GitHub
commit a9c2faaab1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

@ -120,7 +120,7 @@ export const CONSTANTS: {
LatestUpdate: string; LatestUpdate: string;
} = { } = {
VersionString: "1.6.4", VersionString: "1.6.4",
VersionNumber: 15, VersionNumber: 16,
// Speed (in ms) at which the main loop is updated // Speed (in ms) at which the main loop is updated
_idleSpeed: 200, _idleSpeed: 200,

@ -400,8 +400,19 @@ function evaluateVersionCompatibility(ver: string | number): void {
if (ver < 15) { if (ver < 15) {
(Settings as any).EditorTheme = { ...defaultMonacoTheme }; (Settings as any).EditorTheme = { ...defaultMonacoTheme };
} }
//Fix contract names
if (ver < 16) { if (ver < 16) {
Factions[FactionNames.ShadowsOfAnarchy] = new Faction(FactionNames.ShadowsOfAnarchy); Factions[FactionNames.ShadowsOfAnarchy] = new Faction(FactionNames.ShadowsOfAnarchy);
//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";
}
}
}
} }
} }
} }

@ -1250,7 +1250,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
}, },
}, },
{ {
name: "HammingCodes: Integer to encoded Binary", name: "HammingCodes: Integer to Encoded Binary",
numTries: 10, numTries: 10,
difficulty: 5, difficulty: 5,
desc: (n: number): string => { desc: (n: number): string => {