fix graceful material load?

This commit is contained in:
omuretsu 2023-01-02 15:06:44 -05:00
parent 2cb989243f
commit 3f850d71ba

@ -134,6 +134,8 @@ export class Material {
static fromJSON(value: IReviverValue): Material {
// Gracefully load save files from when Scientific Research was considered a Material (pre 2.2).
if (value.data.name === "Scientific Research") return value.data.qty;
if (value.data.name === "RealEstate") value.data.name = "Real Estate";
if (value.data.name === "AICores") value.data.name = "AI Cores";
return Generic_fromJSON(Material, value.data);
}
}