diff --git a/src/data/backwardsCompatibility/backwardsCompatibility.js b/src/data/backwardsCompatibility/backwardsCompatibility.js index 3d5f3383b8bfb1634a313ce83d2699f7c2428ee8..b88de0c1beb512b4446de348e312533f545636a4 100644 --- a/src/data/backwardsCompatibility/backwardsCompatibility.js +++ b/src/data/backwardsCompatibility/backwardsCompatibility.js @@ -257,9 +257,6 @@ App.Update.globalVariables = function(node) { V.IsPastPrimePC = 5000; } - // Looks at all wombs, including PC. - BCReserveInit(); - // Menials { if (typeof V.AMenials !== "undefined") { @@ -2006,6 +2003,18 @@ App.Update.oldVersions = function(node) { V.relationLinks = {}; // init temp structure for mapping relationships from legacy to extended family mode } + V.PC.womb.forEach(function(ft) { + if (typeof ft.reserve !== 'string') { + ft.reserve = ""; + } + if (typeof ft.motherID !== 'number') { + ft.motherID = V.PC.ID; + } + if (typeof ft.realAge !== 'number') { // setting missing chronological age + ft.realAge = ft.age; + } + }); + node.append(`Done!`); }; diff --git a/src/js/wombJS.js b/src/js/wombJS.js index df9d8831ba3d771542f60d77eb0316f97179d610..b8a6b6f1e93d5b9c8f8982c6e23d7effb6c0357e 100644 --- a/src/js/wombJS.js +++ b/src/js/wombJS.js @@ -50,9 +50,23 @@ globalThis.WombInit = function(actor) { } // backward compatibility setup. Fully accurate for normal pregnancy only. + debugger; if (actor.womb.length > 0 && actor.womb[0].genetics === undefined && actor.eggType === "human") { i = 0; actor.womb.forEach(function(ft) { + + if (typeof ft.reserve !== 'string') { + ft.reserve = ""; + } + if (typeof ft.motherID !== 'number') { // setting missing biological mother ID for fetus. + ft.motherID = slave.ID; + } + if (ft.ID === undefined) { + ft.ID = generateNewID(); + } + if (typeof ft.realAge !== 'number') { // setting missing chronological age + ft.realAge = ft.age; + } ft.genetics = generateGenetics(actor, actor.pregSource, i); i++; }); @@ -699,6 +713,7 @@ globalThis.WombFatherRace = function(actor, raceName) { // replaces untraceable fatherIDs with missingParentID. Required for concurrent pregnancy to differentiate between siblings. globalThis.MissingParentIDCorrection = function(actor) { + debugger; WombInit(actor); actor.womb .filter(ft => (ft.genetics.father === 0 || (ft.genetics.father < -1 && ft.genetics.father >= -20 && ft.genetics.father !== -3))) @@ -882,34 +897,3 @@ globalThis.WombGetLittersData = function(actor) { return data; }; - -globalThis.BCReserveInit = function() { - V.slaves.forEach(function(slave) { - slave.womb.forEach(function(ft) { - if (typeof ft.reserve !== 'string') { - ft.reserve = ""; - } - if (typeof ft.motherID !== 'number') { // setting missing biological mother ID for fetus. - ft.motherID = slave.ID; - } - if (ft.ID === undefined) { - ft.ID = generateNewID(); - } - if (typeof ft.realAge !== 'number') { // setting missing chronological age - ft.realAge = ft.age; - } - }); - }); - - V.PC.womb.forEach(function(ft) { - if (typeof ft.reserve !== 'string') { - ft.reserve = ""; - } - if (typeof ft.motherID !== 'number') { - ft.motherID = V.PC.ID; - } - if (typeof ft.realAge !== 'number') { // setting missing chronological age - ft.realAge = ft.age; - } - }); -};