diff --git a/src/js/removeActiveSlave.tw b/src/js/removeActiveSlave.tw index 6b8c3db5675fdfab8d607309771e9d16b04cdef2..889349a420f6d5b664fe9da3d56a2345c30c9be9 100644 --- a/src/js/removeActiveSlave.tw +++ b/src/js/removeActiveSlave.tw @@ -183,6 +183,9 @@ window.removeActiveSlave = function removeActiveSlave() { keep = true; } } + if (isImpregnatedBy(V.PC, V.activeSlave)) { /* did we impregnate the PC */ + keep = true; + } if (!keep) { /* avoid going through this loop if possible */ keep = V.slaves.some(slave => { /* have we impregnated a slave that is not ourself? */ diff --git a/src/pregmod/generateChild.tw b/src/pregmod/generateChild.tw index f4350cb4b2672fcd22a54f6a33fc836e589f91b1..3024ff24e7dbed8fd1837b1fa389869cedc311b4 100644 --- a/src/pregmod/generateChild.tw +++ b/src/pregmod/generateChild.tw @@ -5,10 +5,10 @@ <<set $mergeDad = 0>> <<for $m = 0; $m < $genePool.length; $m++>> <<if $mom.ID == $genePool[$m].ID>> - <<set $mergeMom = $genePool[$m]>> + <<set $mergeMom = clone($genePool[$m])>> <</if>> <<if $mom.pregSource == $genePool[$m].ID>> - <<set $mergeDad = $genePool[$m]>> + <<set $mergeDad = clone($genePool[$m])>> <</if>> <</for>> <<if $mom.pregSource == -1>> diff --git a/src/pregmod/testGenetics.tw b/src/pregmod/testGenetics.tw index 4499bbb868b6665eb60245a5c945ad2912fd09ca..e7064b3cc5231b02a3eaeee43ce31d5155f6bbae 100644 --- a/src/pregmod/testGenetics.tw +++ b/src/pregmod/testGenetics.tw @@ -50,3 +50,15 @@ All slave array slaves MUST be present in genePool or else there is a malfunctio <</if>> <</for>> </table> + +<<if _errorCause>> + @@.red;Errors in the gene pool detected! Please report this.@@ + <<link "Add missing slaves to the gene pool">> + <<for _i = 0; _i < $slaves.length; _i++>> + <<if $genePool.every(function(g) { return $slaves[_i].ID !== g.ID; })>> + <<set $genePool.push($slaves[_i])>> + <</if>> + <</for>> + <<goto "Main">> + <</link>> //This will not fix missing properties.// +<</if>> diff --git a/src/pregmod/widgets/assignmentFilterWidget.tw b/src/pregmod/widgets/assignmentFilterWidget.tw index fb792ea4996fa10f36c1cb93372b7b4f4ae2c9d9..11529c1f5114e7f93338ad5f006e7287c3ada02b 100644 --- a/src/pregmod/widgets/assignmentFilterWidget.tw +++ b/src/pregmod/widgets/assignmentFilterWidget.tw @@ -110,6 +110,6 @@ <<link Spa>><<spaAssignmentFilter>><<replace $args.full>><<include 'Slave Summary'>><</replace>><</link>><<print " | ">> <<link Nursery>><<nurseryAssignmentFilter>><<replace $args.full>><<include 'Slave Summary'>><</replace>><</link>><<print " | ">> <<link Suite>><<suiteAssignmentFilter>><<replace $args.full>><<include 'Slave Summary'>><</replace>><</link>><<print " | ">> - <<link Quarters>><<spaAssignmentFilter>><<replace $args.full>><<include 'Slave Summary'>><</replace>><</link>> + <<link Quarters>><<quartersAssignmentFilter>><<replace $args.full>><<include 'Slave Summary'>><</replace>><</link>> <<resetAssignmentFilter>> <</widget>> \ No newline at end of file diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index fd3b4108516d324b690c64649f6574dfb1f504dd..f038e297b9d236218b056e2850380410b2b75cd4 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -3400,6 +3400,9 @@ Setting missing slave variables: <<set _dontDeleteMe = 1>> <</if>> <</if>> + <<if isImpregnatedBy($PC, _Slave)>> /* did we impregnate the PC */ + <<set _dontDeleteMe = 1>> + <</if>> <<if _dontDeleteMe == 0>> /* avoid going through this loop if possible */ <<for _bci2 = 0; _bci2 < $slaves.length; _bci2++>> <<if isImpregnatedBy($slaves[_bci2], _Slave)>> /* have we impregnated a slave on the slaves array? */ diff --git a/src/uncategorized/cellblock.tw b/src/uncategorized/cellblock.tw index 450f46a28a181f53afc9a1b9a985c8d65bf0c00a..371f3c943d44b89f0704d7b26d37a066e59e5532 100644 --- a/src/uncategorized/cellblock.tw +++ b/src/uncategorized/cellblock.tw @@ -119,7 +119,7 @@ $cellblockNameCaps <<if ($cellblock <= $cellblockSlaves)>> ''$cellblockNameCaps is full and cannot hold any more slaves'' <<elseif ($slaves.length > $cellblockSlaves)>> - <<link "''Send a resistant slave to be broken in the cellblock''">> + <<link "''Send a resistant slave to be broken in $cellblockName''">> <<replace #ComingGoing>> <<resetAssignmentFilter>> <<set $Flag = 0>> @@ -129,7 +129,7 @@ $cellblockNameCaps <</if>> <<if $cellblockSlaves > 0>> - | <<link "''Let a slave out of the cellblock''">> + | <<link "''Let a slave out of $cellblockName''">> <<replace #ComingGoing>> <<cellblockAssignmentFilter>> <<set $Flag = 1>> @@ -138,7 +138,7 @@ $cellblockNameCaps <</replace>> <</link>> <<else>> - <br><br>//The cellblock is empty for the moment.<br>// + <br><br>//$cellblockNameCaps is empty for the moment.<br>// <</if>> <br><br> <<assignmentFilter>> diff --git a/src/uncategorized/clinic.tw b/src/uncategorized/clinic.tw index 941cdcd254ca30066b2ae2682d0f45b0b6de6711..cc13f403f254525c557672c98176d2b42bab94e9 100644 --- a/src/uncategorized/clinic.tw +++ b/src/uncategorized/clinic.tw @@ -154,7 +154,7 @@ $clinicNameCaps <</if>> <<if $clinicSlaves > 0>> - | <<link "''Take a slave out of the clinic''">> + | <<link "''Take a slave out of $clinicName''">> <<replace #ComingGoing>> <<clinicAssignmentFilter>> <<set $Flag = 1>> @@ -163,7 +163,7 @@ $clinicNameCaps <</replace>> <</link>> <<else>> - <br><br>//The clinic is empty for the moment.<br>// + <br><br>//$clinicNameCaps is empty for the moment.<br>// <</if>> <br><br> <<assignmentFilter>> diff --git a/src/uncategorized/masterSuite.tw b/src/uncategorized/masterSuite.tw index 563f60d2dde9e25da2b821823c4ae2ece772655f..234f7c72c83a4ab66a47a23726c0450a744ed053 100644 --- a/src/uncategorized/masterSuite.tw +++ b/src/uncategorized/masterSuite.tw @@ -366,7 +366,7 @@ $masterSuiteNameCaps is furnished <</if>> <<if $masterSuiteSlaves > 0>> - | <<link "''Bring a slave out of the master suite''">> + | <<link "''Bring a slave out of $masterSuiteName''">> <<replace #ComingGoing>> <<suiteAssignmentFilter>> <<set $Flag = 1>> diff --git a/src/uncategorized/schoolroom.tw b/src/uncategorized/schoolroom.tw index 9e1296800f356ef972a9e0b91e98d9bd174962b2..74072d25e591c9c9599484e66971fae7dbb83306 100644 --- a/src/uncategorized/schoolroom.tw +++ b/src/uncategorized/schoolroom.tw @@ -144,7 +144,7 @@ $schoolroomNameCaps is well-equipped, with wallscreens to display lessons. These <</replace>> <</link>> <<else>> - <br><br>//The classroom is empty for the moment.<br>// + <br><br>//$schoolroomNameCaps is empty for the moment.<br>// <</if>> <br><br> <<assignmentFilter>> diff --git a/src/uncategorized/slaveSummary.tw b/src/uncategorized/slaveSummary.tw index 9b97ca6f607ec70327452190626c070543de7c59..a6d4430f33fd78dca31ef1cc9354fe3f323f517b 100644 --- a/src/uncategorized/slaveSummary.tw +++ b/src/uncategorized/slaveSummary.tw @@ -769,9 +769,9 @@ will <<case "Spa">> <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> <<if $Flag == 0>> - [[Send her to the Spa|Assign][$i = _ssi]] + <<link "Send her to $spaName" "Assign">><<set $i = _ssi>><</link>> <<elseif $Flag == 1>> - [[Remove her from the Spa|Retrieve][$i = _ssi]] + <<link "Remove her from $spaName" "Retrieve">><<set $i = _ssi>><</link>> <<else>> [[Change or remove Attendant|Attendant Select]] <<break>> @@ -783,9 +783,9 @@ will <<case "Nursery">> <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> <<if $Flag == 0>> - [[Send her to the Nursery|Assign][$i = _ssi]] + <<link "Send her to $nurseryName" "Assign">><<set $i = _ssi>><</link>> <<elseif $Flag == 1>> - [[Remove her from the Nursery|Retrieve][$i = _ssi]] + <<link "Remove her from $nurseryName" "Retrieve">><<set $i = _ssi>><</link>> <<else>> [[Change or remove Matron|Matron Select]] <<break>> @@ -797,9 +797,9 @@ will <<case "Brothel">> <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> <<if $Flag == 0>> - [[Send her to the Brothel|Assign][$i = _ssi]] + <<link "Send her to $brothelName" "Assign">><<set $i = _ssi>><</link>> <<elseif $Flag == 1>> - [[Release her from the Brothel|Retrieve][$i = _ssi]] + <<link "Release her from $brothelName" "Retrieve">><<set $i = _ssi>><</link>> <<else>> [[Change or remove Madam|Madam Select]] <<break>> @@ -811,9 +811,9 @@ will <<case "Club">> <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> <<if $Flag == 0>> - [[Send her to the Club|Assign][$i = _ssi]] + <<link "Send her to $clubName" "Assign">><<set $i = _ssi>><</link>> <<elseif $Flag == 1>> - [[Remove her from the Club|Retrieve][$i = _ssi]] + <<link "Remove her from $clubName" "Retrieve">><<set $i = _ssi>><</link>> <<else>> [[Change or remove DJ|DJ Select]] <<break>> @@ -821,9 +821,9 @@ will <<case "Arcade">> <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> <<if $Flag == 0>> - [[Confine her in the Arcade|Assign][$i = _ssi]] + <<link "Confine her in $arcadeName" "Assign">><<set $i = _ssi>><</link>> <<else>> - [[Release her from the Arcade|Retrieve][$i = _ssi]] + <<link "Release her from $arcadeName" "Retrieve">><<set $i = _ssi>><</link>> <</if>> <<case "DJ Select">> <<if setup.DJCareers.includes(_Slave.career) || (_Slave.skillDJ >= $masteredXP)>> @@ -835,9 +835,9 @@ will @@.cyan;Estimated DNA error value: <<print Math.ceil(_Slave.chem/10)>>@@ <</if>> <<if $Flag == 0>> - [[Send her to the Clinic|Assign][$i = _ssi]] + <<link "Send her to $clinicName" "Assign">><<set $i = _ssi>><</link>> <<elseif $Flag == 1>> - [[Take her out of the Clinic|Retrieve][$i = _ssi]] + <<link "Take her out of $clinicName" "Retrieve">><<set $i = _ssi>><</link>> <<else>> [[Change or remove Nurse|Nurse Select]] <<break>> @@ -849,9 +849,9 @@ will <<case "Schoolroom">> <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> <<if $Flag == 0>> - [[Assign her to the Schoolroom|Assign][$i = _ssi]] + <<link "Assign her to $schoolroomName" "Assign">><<set $i = _ssi>><</link>> <<elseif $Flag == 1>> - [[Release her from the Schoolroom|Retrieve][$i = _ssi]] + <<link "Release her from $schoolroomName" "Retrieve">><<set $i = _ssi>><</link>> <<else>> [[Change or remove Schoolteacher|Schoolteacher Select]] <<break>> @@ -863,9 +863,9 @@ will <<case "Dairy">> <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> <<if $Flag == 0>> - [[Send her to the Dairy|Assign][$i = _ssi]] + <<link "Send her to $dairyName" "Assign">><<set $i = _ssi>><</link>> <<elseif $Flag == 1>> - [[Release her from the Dairy|Retrieve][$i = _ssi]] + <<link "Release her from $dairyName" "Retrieve">><<set $i = _ssi>><</link>> <<else>> [[Change or remove Milkmaid|Milkmaid Select]] <<break>> @@ -877,9 +877,9 @@ will <<case "Servants' Quarters">> <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> <<if $Flag == 0>> - [[Assign her to the Servants' Quarters|Assign][$i = _ssi]] + <<link "Assign her to $servantsQuartersName" "Assign">><<set $i = _ssi>><</link>> <<elseif $Flag == 1>> - [[Release her from the Servants' Quarters|Retrieve][$i = _ssi]] + <<link "Release her from $servantsQuartersName" "Retrieve">><<set $i = _ssi>><</link>> <<else>> [[Change or remove Stewardess|Stewardess Select]] <<break>> @@ -891,9 +891,9 @@ will <<case "Master Suite">> <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> <<if $Flag == 0>> - [[Add her to the Suite|Assign][$i = _ssi]] + <<link "Add her to $masterSuiteName" "Assign">><<set $i = _ssi>><</link>> <<elseif $Flag == 1>> - [[Send her out of the Suite|Retrieve][$i = _ssi]] + <<link "Send her out of $masterSuiteName" "Retrieve">><<set $i = _ssi>><</link>> <<else>> [[Change or remove Concubine|Concubine Select]] <<break>> @@ -901,9 +901,9 @@ will <<case "Cellblock">> <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> <<if $Flag == 0>> - [[Confine her in the cellblock|Assign][$i = _ssi]] + <<link "Confine her in $cellblockName" "Assign">><<set $i = _ssi>><</link>> <<elseif $Flag == 1>> - [[Release her from the cellblock|Retrieve][$i = _ssi]] + <<link "Release her from $cellblockName" "Retrieve">><<set $i = _ssi>><</link>> <<else>> [[Change or remove Wardeness|Wardeness Select]] <<break>> diff --git a/src/uncategorized/spa.tw b/src/uncategorized/spa.tw index 3158bd350049514f67d413925807fe42252478bb..cdee476ea3a55b52fe905f425b56e27634f46a67 100644 --- a/src/uncategorized/spa.tw +++ b/src/uncategorized/spa.tw @@ -138,7 +138,7 @@ $spaNameCaps <</if>> <<if $spaSlaves > 0>> - | <<link "''Prise a slave out of the spa''">> + | <<link "''Prise a slave out of $spaName''">> <<replace #ComingGoing>> <<spaAssignmentFilter>> <<set $Flag = 1>> @@ -147,7 +147,7 @@ $spaNameCaps <</replace>> <</link>> <<else>> - <br><br>//The spa is empty at the moment.<br>// + <br><br>//$spaNameCaps is empty at the moment.<br>// <</if>> <span id="ComingGoing">