mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-03 22:37:06 +02:00
Various fixes to our upgrade logic (#536)
Stuff broke over time, especially with the major changes we made leading up to 2.3. We should test with older saves if/when we make large changes in the future. Fixes #532
This commit is contained in:
+6
-2
@@ -1,6 +1,7 @@
|
||||
import { convertTimeMsToTimeElapsedString } from "./utils/StringHelperFunctions";
|
||||
import { initAugmentations } from "./Augmentation/AugmentationHelpers";
|
||||
import { AugmentationNames } from "./Augmentation/data/AugmentationNames";
|
||||
import { initBitNodeMultipliers } from "./BitNode/BitNode";
|
||||
import { initSourceFiles } from "./SourceFile/SourceFiles";
|
||||
import { generateRandomContract } from "./CodingContractGenerator";
|
||||
import { initCompanies } from "./Company/Companies";
|
||||
@@ -229,11 +230,14 @@ const Engine: {
|
||||
load: function (saveString) {
|
||||
startExploits();
|
||||
setupUncaughtPromiseHandler();
|
||||
// Source files must be initialized early because save-game translation in
|
||||
// loadGame() needs them sometimes.
|
||||
initSourceFiles();
|
||||
// Load game from save or create new game
|
||||
|
||||
if (loadGame(saveString)) {
|
||||
FormatsNeedToChange.emit();
|
||||
initSourceFiles();
|
||||
initBitNodeMultipliers();
|
||||
initAugmentations(); // Also calls Player.reapplyAllAugmentations()
|
||||
Player.reapplyAllSourceFiles();
|
||||
if (Player.hasWseAccount) {
|
||||
@@ -374,7 +378,7 @@ const Engine: {
|
||||
} else {
|
||||
// No save found, start new game
|
||||
FormatsNeedToChange.emit();
|
||||
initSourceFiles();
|
||||
initBitNodeMultipliers();
|
||||
Engine.start(); // Run main game loop and Scripts loop
|
||||
Player.init();
|
||||
initForeignServers(Player.getHomeComputer());
|
||||
|
||||
Reference in New Issue
Block a user