From 30d155c5323b3ce064f698766865ac86f9e6bd4c Mon Sep 17 00:00:00 2001
From: Pregmodder <pregmodder@gmail.com>
Date: Thu, 28 Sep 2023 17:13:11 -0400
Subject: [PATCH] fix incubator undefineds

---
 src/npc/generate/newChildIntro.js | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/src/npc/generate/newChildIntro.js b/src/npc/generate/newChildIntro.js
index 189871626eb..fa70dd3be5a 100644
--- a/src/npc/generate/newChildIntro.js
+++ b/src/npc/generate/newChildIntro.js
@@ -18,19 +18,28 @@ App.UI.newChildIntro = function(slave) {
 
 	let tempParents = "";
 
-	r.push(`You completed the legalities before heading to ${V.incubator.name}, knowing the tank will release ${him} on your approach,`);
+	r.push(`You completed the legalities before heading to ${V.incubator.name}, knowing the tank will release ${him} on your`);
 
-	if (tempMom.ID === V.PC.ID && tempDad.ID === V.PC.ID) {
-	} else if (tempMom.ID === V.PC.ID) {
-		tempParents = "father";
-	} else if (tempDad.ID === V.PC.ID) {
-		tempParents = "mother";
-	} else {
-		tempParents = "parents";
+	if (tempDad) {
+		if (tempDad.ID !== V.PC.ID) {
+			tempParents = "father";
+		}
+	}
+	if (tempMom) {
+		if (tempMom.ID !== V.PC.ID) {
+			tempParents = "mother";
+		}
+		if (tempDad) {
+			if (tempMom.ID !== V.PC.ID && tempDad.ID !== V.PC.ID && tempMom.ID !== tempDad.ID) {
+				tempParents = "parents";
+			}
+		}
 	}
 
 	if (tempParents !== "") {
-		r.push(`and instruct ${V.assistant.name} to notify the new ${girl}'s ${tempParents} to meet you in your office.`);
+		r.push(`approach, and instruct ${V.assistant.name} to notify the new ${girl}'s ${tempParents} to meet you in your office.`);
+	} else {
+		r.push(`approach.`);
 	}
 
 	r.push(`As the tank exhumes the disoriented ${girl},`);
-- 
GitLab