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:
David Walker
2023-05-26 21:16:31 -07:00
committed by GitHub
parent ab207ce36c
commit db26d054fc
6 changed files with 58 additions and 54 deletions
+3
View File
@@ -34,6 +34,9 @@ export function Reviver(_key: string, value: unknown): any {
case "Industry":
console.warn("Converting a corp from pre-2.3");
return value.data; // Will immediately be overwritten by v2.3 save migration code
case "Employee":
console.warn("Converting a corp from pre-2.2");
return value.data; // Will immediately be overwritten by v2.3 save migration code
}
// Missing constructor with no special handling. Throw error.
throw new Error(`Could not locate constructor named ${value.ctor}. If the save data is valid, this is a bug.`);