From d48764f3b49b8020a905df1812f18c8ff850a011 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Mon, 5 Oct 2020 22:38:46 -0400 Subject: [PATCH] Revert "simplier" This reverts commit 73d3f3ea090892314b97f8b8920feb618fb4eca7. --- src/js/birth/birth.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/birth/birth.js b/src/js/birth/birth.js index 71291585042..87116c2a8e9 100644 --- a/src/js/birth/birth.js +++ b/src/js/birth/birth.js @@ -690,6 +690,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {}) function calcBirthDamage() { /* I think all this reactions should be showed only if no c'section used too. Setting it up for just in case: */ if (!cSection && slave.assignment !== "work in the dairy") { // if not desired, this check can be easily removed or deactivated with condition set to true. + let hasDamage; p = document.createElement("p"); let r = []; if (newMother) { @@ -860,6 +861,9 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {}) ]); birthDamage += 2; } + if (r.length > 0) { + hasDamage = true; + } for (const malus of r) { App.Events.addNode(p, malus, "div"); @@ -977,7 +981,7 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false} = {}) birthDamage -= 5; } - if (birthDamage > 0 && r.length > 0) { + if (hasDamage && r.length > 0) { App.UI.DOM.appendNewElement("div", p, `However:`); } -- GitLab