From 1ed765b4259f1554dff2df5c65a53c8ade83a6dd Mon Sep 17 00:00:00 2001 From: Frankly George <54015-franklygeorge@users.noreply.gitgud.io> Date: Sat, 4 May 2024 21:53:12 +0000 Subject: [PATCH] Nursery Fix --- src/npc/children/childSummary.js | 16 ++++++++-------- src/npc/children/longChildDescription.js | 14 +++++++------- src/npc/infants/infantSummary.js | 14 +++++++------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/npc/children/childSummary.js b/src/npc/children/childSummary.js index 068bd192235..66cbd7e5c02 100644 --- a/src/npc/children/childSummary.js +++ b/src/npc/children/childSummary.js @@ -2757,13 +2757,13 @@ App.Facilities.Nursery.ChildSummary = function(child) { * @param {FC.SlaveState} child */ function shortPornPrestige(child) { - if (child.porn.prestige > 0) { + if (child.porn?.prestige > 0) { r += `<span class="green">`; - if (child.porn.prestige > 2) { + if (child.porn?.prestige > 2) { r += `PPrest++`; - } else if (child.porn.prestige === 2) { + } else if (child.porn?.prestige === 2) { r += `PPrest+`; - } else if (child.porn.prestige === 1) { + } else if (child.porn?.prestige === 1) { r += `PPrest`; } r += `</span> `; @@ -2899,13 +2899,13 @@ App.Facilities.Nursery.ChildSummary = function(child) { * @param {FC.SlaveState} child */ function longPornPrestige(child) { - if (child.porn.prestige > 0) { + if (child.porn?.prestige > 0) { r += `<span class="green">`; - if (child.porn.prestige > 2) { + if (child.porn?.prestige > 2) { r += `Porn star. `; - } else if (child.porn.prestige === 2) { + } else if (child.porn?.prestige === 2) { r += `Porn slut. `; - } else if (child.porn.prestige === 1) { + } else if (child.porn?.prestige === 1) { r += `Porn amateur. `; } r += `</span> `; diff --git a/src/npc/children/longChildDescription.js b/src/npc/children/longChildDescription.js index fc4b59de590..54ec594c66c 100644 --- a/src/npc/children/longChildDescription.js +++ b/src/npc/children/longChildDescription.js @@ -7316,23 +7316,23 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event } } - if (child.porn.prestige > 0) { - if (child.porn.prestigeDesc) { + if (child.porn?.prestige > 0) { + if (child.porn?.prestigeDesc) { r += `${child.porn.prestigeDesc} `; } } - if (child.prestige > 0 || child.porn.prestige > 0) { - if (child.porn.prestige > 2) { + if (child.prestige > 0 || child.porn?.prestige > 0) { + if (child.porn?.prestige > 2) { r += `As such, ${he} tends to gain a following wherever ${he} goes. `; - } else if (child.porn.prestige > 1) { + } else if (child.porn?.prestige > 1) { r += `As such, ${he} is recognized often. `; } else { r += `As such, ${he} is recognized occasionally. `; } } - if (child.prestige > 0 || child.porn.prestige > 1) { + if (child.prestige > 0 || child.porn?.prestige > 1) { if (child.markings === "birthmark") { r += `${He} has a large, liver-colored birthmark, but since ${he}'s well known, this uniqueness adds to ${his} beauty rather than detracting from it. `; } @@ -7816,7 +7816,7 @@ App.Facilities.Nursery.LongChildDescription = function(child, {market = 0, event r += accent(child); } - if (child.markings === "birthmark" && !child.prestige && child.porn.prestige < 2) { + if (child.markings === "birthmark" && !child.prestige && child.porn?.prestige < 2) { r += `${He} has a large, liver-colored birthmark, detracting from ${his} beauty. `; } if (child.skin === "sun tanned") { diff --git a/src/npc/infants/infantSummary.js b/src/npc/infants/infantSummary.js index 9c112546901..945569b78c0 100644 --- a/src/npc/infants/infantSummary.js +++ b/src/npc/infants/infantSummary.js @@ -28,7 +28,7 @@ App.Facilities.Nursery.InfantSummary = function(child) { if (child.prestige > 0) { r += prestige(); } - if (child.porn.prestige > 0) { + if (child.porn?.prestige > 0) { r += pornPrestige(); } r += behavioralFlaw(); @@ -1317,11 +1317,11 @@ App.Facilities.Nursery.InfantSummary = function(child) { function shortPornPrestige() { let r = `<span class="green">`; - if (child.porn.prestige > 2) { + if (child.porn?.prestige > 2) { r += `PPrest++`; - } else if (child.porn.prestige === 2) { + } else if (child.porn?.prestige === 2) { r += `PPrest+`; - } else if (child.porn.prestige === 1) { + } else if (child.porn?.prestige === 1) { r += `PPrest`; } r += `</span> `; @@ -1332,11 +1332,11 @@ App.Facilities.Nursery.InfantSummary = function(child) { function longPornPrestige() { let r = `<span class="green">`; - if (child.porn.prestige > 2) { + if (child.porn?.prestige > 2) { r += `Porn star. `; - } else if (child.porn.prestige === 2) { + } else if (child.porn?.prestige === 2) { r += `Porn slut. `; - } else if (child.porn.prestige === 1) { + } else if (child.porn?.prestige === 1) { r += `Porn amateur. `; } r += `</span> `; -- GitLab