fix corp not loading

This commit is contained in:
Olivier Gagnon 2021-11-11 22:43:40 -05:00
parent 0114c92829
commit 9d435bbe47
5 changed files with 18 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -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);
},
};