Merge pull request #1698 from danielyxie/dev

fix corp not loading
This commit is contained in:
hydroflame 2021-11-11 22:45:40 -05:00 committed by GitHub
commit 9f14c38396
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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

@ -155,7 +155,6 @@ export class Corporation {
if (this.unlockUpgrades[6] === 1) {
upgrades += 0.1;
}
console.log(upgrades);
return Math.pow(dividends, BitNodeMultipliers.CorporationSoftCap + upgrades);
}

@ -227,6 +227,22 @@ function evaluateVersionCompatibility(ver: string | number): void {
Player.reapplyAllAugmentations(true);
Player.reapplyAllSourceFiles();
}
if (ver < 3) {
anyPlayer.money = parseFloat(anyPlayer.money);
if (anyPlayer.corporation) {
anyPlayer.corporation.funds = parseFloat(anyPlayer.corporation.funds);
anyPlayer.corporation.revenue = parseFloat(anyPlayer.corporation.revenue);
anyPlayer.corporation.expenses = parseFloat(anyPlayer.corporation.expenses);
for (let i = 0; i < anyPlayer.corporation.divisions.length; ++i) {
const ind = anyPlayer.corporation.divisions[i];
ind.lastCycleRevenue = parseFloat(ind.lastCycleRevenue);
ind.lastCycleExpenses = parseFloat(ind.lastCycleExpenses);
ind.thisCycleRevenue = parseFloat(ind.thisCycleRevenue);
ind.thisCycleExpenses = parseFloat(ind.thisCycleExpenses);
}
}
}
}
}

@ -282,6 +282,5 @@ export const Settings: ISettings & ISelfInitializer & ISelfLoading = {
Object.assign(Settings.theme, save.theme);
delete save.theme;
Object.assign(Settings, save);
console.log(Settings.TimestampsFormat);
},
};