mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-01 20:13:51 +01:00
BUGFIX: Cannot load Bladeburner tasks of Sleeves from pre-v2.6.1 (#1800)
This commit is contained in:
parent
22b6458c22
commit
88322a23a7
@ -100,8 +100,20 @@ export class SleeveBladeburnerWork extends SleeveWorkClass {
|
||||
/** Initializes a BladeburnerWork object from a JSON save state. */
|
||||
static fromJSON(value: IReviverValue): SleeveBladeburnerWork {
|
||||
objectAssert(value.data);
|
||||
const actionId = loadActionIdentifier(value.data?.actionId);
|
||||
if (!actionId) return invalidWork();
|
||||
let actionId = loadActionIdentifier(value.data?.actionId);
|
||||
if (!actionId) {
|
||||
/**
|
||||
* In pre-v2.6.1 versions, "name" and "type" of actionId are saved directly in "actionName" and "actionType", not
|
||||
* in the actionId object.
|
||||
*/
|
||||
if (!value.data["actionName"]) {
|
||||
return invalidWork();
|
||||
}
|
||||
actionId = loadActionIdentifier({ name: value.data["actionName"], type: value.data["actionType"] });
|
||||
if (!actionId) {
|
||||
return invalidWork();
|
||||
}
|
||||
}
|
||||
value.data.actionId = actionId;
|
||||
return Generic_fromJSON(SleeveBladeburnerWork, value.data, SleeveBladeburnerWork.savedKeys);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user