mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-18 13:42:08 +02:00
REFACTOR: Handle migration of ActionIdentifier in Bladeburner code instead of GenericReviver (#1799)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { loadActionIdentifier } from "../Bladeburner/utils/loadActionIdentifier";
|
||||
import { constructorsForReviver, isReviverValue } from "./JSONReviver";
|
||||
import { validateObject } from "./Validator";
|
||||
|
||||
@@ -21,10 +20,9 @@ export function Reviver(_key: string, value: unknown): any {
|
||||
case "Employee": // Entire object removed from game in v2.2.0 (employees abstracted)
|
||||
case "Company": // Reviver removed in v2.6.1
|
||||
case "Faction": // Reviver removed in v2.6.1
|
||||
case "ActionIdentifier": // No longer a class as of v2.6.1
|
||||
console.warn(`Legacy load type ${value.ctor} converted to expected format while loading.`);
|
||||
return value.data;
|
||||
case "ActionIdentifier": // No longer a class as of v2.6.1
|
||||
return loadActionIdentifier(value.data);
|
||||
}
|
||||
// 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.`);
|
||||
|
||||
Reference in New Issue
Block a user