From a1767610b53e80cfe5beeed7ff0cb2d5c23c28bf Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Thu, 29 Oct 2020 01:56:32 -0400 Subject: [PATCH] simplify parent checks --- src/npc/generate/newChildIntro.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/npc/generate/newChildIntro.js b/src/npc/generate/newChildIntro.js index 26e5b837e75..8b6c5ce5bab 100644 --- a/src/npc/generate/newChildIntro.js +++ b/src/npc/generate/newChildIntro.js @@ -13,19 +13,12 @@ App.UI.newChildIntro = function(slave) { let dadInterest; /** @type {FC.SlaveStateOrZero} */ - let tempMom = 0; + const tempMom = getSlave(slave.mother); /** @type {FC.SlaveStateOrZero} */ - let tempDad = 0; + const tempDad = getSlave(slave.father); App.Utils.setLocalPronouns(slave); - if (slave.mother > 0) { - tempMom = getSlave(slave.mother) || 0; - } - if (slave.father > 0) { - tempDad = getSlave(slave.father) || 0; - } - r = []; r.push(`You completed the legalities before heading to ${V.incubatorName}, knowing the tank will release ${him} on your approach, and instruct ${V.assistant.name} to notify the new ${girl}'s parents to meet you in your office. As the tank exhumes the disoriented ${girl},`); @@ -232,10 +225,10 @@ App.UI.newChildIntro = function(slave) { } // Parent naming - if (tempMom !== 0) { + if (tempMom) { naming.append(parentNaming(tempMom)); } - if (tempDad !== 0 && slave.father !== slave.mother) { + if (tempDad && slave.father !== slave.mother) { naming.append(parentNaming(tempDad)); } el.append(naming); -- GitLab