mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
Fixed bug and added compatibility for converting RunningScript offline dataMap to version v0.43.1
This commit is contained in:
@@ -15,7 +15,15 @@ function Reviver(key, value) {
|
||||
if (typeof value === "object" &&
|
||||
typeof value.ctor === "string" &&
|
||||
typeof value.data !== "undefined") {
|
||||
// Compatibility for version v0.43.1
|
||||
// TODO Remove this eventually
|
||||
if (value.ctor === "AllServersMap") {
|
||||
console.log('Converting AllServersMap for v0.43.1');
|
||||
return value.data;
|
||||
}
|
||||
|
||||
ctor = Reviver.constructors[value.ctor] || window[value.ctor];
|
||||
|
||||
if (typeof ctor === "function" &&
|
||||
typeof ctor.fromJSON === "function") {
|
||||
|
||||
@@ -45,7 +53,7 @@ function Generic_toJSON(ctorName, obj, keys) {
|
||||
}
|
||||
|
||||
data = {};
|
||||
for (index = 0; index < keys.length; ++index) {
|
||||
for (let index = 0; index < keys.length; ++index) {
|
||||
key = keys[index];
|
||||
data[key] = obj[key];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user