diff --git a/src/npc/children/childSummary.js b/src/npc/children/childSummary.js index 068bd192235fd9b9177016791f4b8b96f788753b..66cbd7e5c02a2a85a703348784c273d08afffa57 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 fc4b59de59037f084f92b1549d51f67900dcf131..54ec594c66c06ed24920b62af6a29baed59d15ff 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 9c112546901859dba3035c4f045f9bbb0682e39c..945569b78c034c56552d542374074a6e96527c26 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> `;