diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt index a91d37abdd7ece3f53be62ec282a61a42bff6cfb..d1d9ca603c7197f90f061a50b9b981397b514ff9 100644 --- a/devNotes/twine JS.txt +++ b/devNotes/twine JS.txt @@ -9974,8 +9974,19 @@ window.generateGenetics = (function() { function generateGenetics(actor1, actor2, x) { V = State.variables; genes = {gender: "XX", name: "blank", surname: 0, mother: 0, motherName: "none", father: 0, fatherName: "none", nationality: "Stateless", race: "white", intelligence: 0, face: 0, eyeColor: "brown", hColor: "black", skin: "white", markings: "none", behavioralFlaw: "none", sexualFlaw: "none", pubicHSyle: "bushy", underArmHStyle: "bushy", geneticQuirks: 0}; - mother = (actor1 > 0) ? V.genePool.findIndex(function(s) { return s.ID == actor1; }) : V.PC; - activeMother = (actor1 > 0) ? V.slaves[V.slaveIndices[actor1]] : V.PC; + if (actor1.ID > 0) { + mother = V.genePool.findIndex(function(s) { return s.ID == actor1.ID; }); + if (mother === undefined) { + mother = actor1; + } + activeMother = V.slaves[V.slaveIndices[actor1]]; + if (activeMother === undefined) { + activeMother = actor1; + } + } else { + activeMother = V.PC; + mother = V.PC; + } father = (actor2 > 0) ? V.genePool.findIndex(function(s) { return s.ID == actor2; }) : (actor2 == -1) ? V.PC : 0; @@ -9985,7 +9996,7 @@ window.generateGenetics = (function() { genes.gender = setGender(father); genes.name = setName(x); - genes.mother = setMotherID(actor1); + genes.mother = setMotherID(actor1.ID); genes.motherName = setMotherName(activeMother); genes.father = setFatherID(actor2); genes.fatherName = setFatherName(father, activeFather); @@ -10033,8 +10044,8 @@ window.generateGenetics = (function() { } // motherID - function setMotherID(actor1) { - return actor1; + function setMotherID(actor1ID) { + return actor1ID; } // motherName @@ -10863,7 +10874,7 @@ window.WombImpregnate = function(actor, fCount, fatherID, age) { tf.volume = 1; //Initial, to create property. Updated with actual data after WombGetVolume call. tf.reserve = ""; //Initial, to create property. Used later to mark if this child is to be kept. tf.identical = 0; //Initial, to create property. Updated with actual data during fetalSplit call. - tf.genetics = generateGenetics(actor.ID, fatherID, i+1); //Stored genetic information. + tf.genetics = generateGenetics(actor, fatherID, i+1); //Stored genetic information. try { if (actor.womb.length == 0) { diff --git a/src/pregmod/sePlayerBirth.tw b/src/pregmod/sePlayerBirth.tw index a7d78a02de593563ec42194db468dddb18a67d10..705eb0163d50e9443e19b1cca28722425525e5af 100644 --- a/src/pregmod/sePlayerBirth.tw +++ b/src/pregmod/sePlayerBirth.tw @@ -77,7 +77,7 @@ PC.pregSource documentation <<set _babies.push("some guy")>> <</if>> <</if>> -<</if>> +<</for>> <<set _babiesReduced = removeDuplicates(_babies)>> <<if _elite > 0>> /* for simplicity's sake, not going to allow other embryos to be added during a elite pregnancy */