From 489b205ee59cc9b94097c4442a71919c05533b5f Mon Sep 17 00:00:00 2001 From: lowercase-donkey <lowercasedonkey@gmail.com> Date: Thu, 29 Aug 2019 01:29:30 -0400 Subject: [PATCH] fixes --- src/facilities/nursery/nurseryWidgets.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/facilities/nursery/nurseryWidgets.js b/src/facilities/nursery/nurseryWidgets.js index 38caa3a2689..2ff911ca526 100644 --- a/src/facilities/nursery/nurseryWidgets.js +++ b/src/facilities/nursery/nurseryWidgets.js @@ -2055,17 +2055,21 @@ App.Facilities.Nursery.LongInfantDescription = function(child) { if (child.father !== 0) { if (V.showMissingSlaves && child.father in V.missingTable) { pName = `your former slave ${V.missingTable[child.father].slaveName}`; - } else { + } else if (child.father in V.slaveIndices) { pName = V.slaves[V.slaveIndices[child.father]].slaveName; } - r += `${He} was <span class="lightgreen">fathered by ${pName}'s</span> virile dick. `; + if (pName) { + r += `${He} was <span class="lightgreen">fathered by ${pName}'s</span> virile dick. `; + } } else if (child.mother !== 0) { if (V.showMissingSlaves && child.mother in V.missingTable) { pName = `your former slave ${V.missingTable[child.mother].slaveName}`; - } else { + } else if (child.mother in V.slaveIndices){ pName = V.slaves[V.slaveIndices[child.mother]].slaveName; } - r += `${He} was born from ${pName}'s fertile womb. `; + if (pName) { + r += `${He} was born from ${pName}'s fertile womb. `; + } } } } @@ -2398,7 +2402,7 @@ App.Facilities.Nursery.LongInfantDescription = function(child) { /* CLOSE FAMILY */ - if (father && father === PC) { + if (father && fatherPC) { if (child.eyeColor === PC.eyeColor) { r += `${He} has your ${child.eyeColor} eyes, `; } else if (mother) { @@ -2409,6 +2413,8 @@ App.Facilities.Nursery.LongInfantDescription = function(child) { r += `${He} has ${his} father ${father.slaveName}'s ${child.eyeColor} eyes, `; } else if (mother) { r += `${He} has ${his} mother ${mother.slaveName}'s ${child.eyeColor} eyes, `; + } else { + r += `${He} has ${child.eyeColor} eyes, `; } } r += ` and ${he} will most likely have ${child.hColor} hair when ${he}'s older. `; -- GitLab