diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 6ef0ebd4b883aef8b8b374ee6b426623777058e6..d63b39821ce6020cbee0c36ebffc7b9c38628e50 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -198,6 +198,20 @@ App.Data.defaultGameStateVariables = { secExpEnabled: 0, }; +// Corp data +App.Data.CorpInitData = { + Announced: 0, + Incorporated: 0, + Market: 0, + Econ: 0, + CashDividend: 0, + Div: 0, + ExpandToken: 0, + Spec: 0, + SpecToken: 0, + SpecRaces: [] +}; + // The other half of the above whitelist. However, entries in this array will be forced to the values set here upon starting NG+. App.Data.resetOnNGPlus = { targetArcology: {fs: "New"}, @@ -221,18 +235,7 @@ App.Data.resetOnNGPlus = { ServQiIDs: [], SpaiIDs: [], NurseryiIDs: [], - corp: { - Announced: 0, - Incorporated: 0, - Market: 0, - Econ: 0, - CashDividend: 0, - Div: 0, - ExpandToken: 0, - Spec: 0, - SpecToken: 0, - SpecRaces: [] - }, + corp: App.Data.CorpInitData, dividendTimer: 0, personalShares: 0, publicShares: 0, diff --git a/src/data/backwardsCompatibility/backwardsCompatibility.js b/src/data/backwardsCompatibility/backwardsCompatibility.js index b04dee293837652adc3a40e16fd17b8da617954f..c33af649825aef195232d8effd18889f37e54146 100644 --- a/src/data/backwardsCompatibility/backwardsCompatibility.js +++ b/src/data/backwardsCompatibility/backwardsCompatibility.js @@ -937,6 +937,11 @@ App.Update.globalVariables = function() { } } } + + /* if we managed to end up in a state where the corp isn't properly defined, forcefully reset it to starting conditions */ + if (typeof V.corp.Incorporated === "undefined") { + V.corp = clone(App.Data.CorpInitData); + } } // Organs