From a88f14cd16e3d9c75313a5cb4a3ca516b7d7b37c Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Thu, 18 Aug 2022 12:36:30 -0400 Subject: [PATCH] Fix broken ns filenames --- src/Constants.ts | 2 +- src/SaveObject.tsx | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Constants.ts b/src/Constants.ts index f7b96ba20..f5715c92f 100644 --- a/src/Constants.ts +++ b/src/Constants.ts @@ -89,7 +89,7 @@ export const CONSTANTS: { LatestUpdate: string; } = { VersionString: "2.0.1", - VersionNumber: 23, + VersionNumber: 24, // Speed (in ms) at which the main loop is updated _idleSpeed: 200, diff --git a/src/SaveObject.tsx b/src/SaveObject.tsx index 7fb77235d..8cabb475d 100755 --- a/src/SaveObject.tsx +++ b/src/SaveObject.tsx @@ -36,6 +36,7 @@ import { Faction } from "./Faction/Faction"; import { safetlyCreateUniqueServer } from "./Server/ServerHelpers"; import { SpecialServers } from "./Server/data/SpecialServers"; import { v2APIBreak } from "./utils/v2APIBreak"; +import { Script } from "./Script/Script"; /* SaveObject.js * Defines the object used to save/load games @@ -490,6 +491,9 @@ function evaluateVersionCompatibility(ver: string | number): void { if (ver < 23) { anyPlayer.currentWork = null; } + if (ver < 24) { + Player.getHomeComputer().scripts.forEach((s) => s.filename.endsWith(".ns") && (s.filename += ".js")); + } } }