diff --git a/src/js/birth/birth.js b/src/js/birth/birth.js index 71291585042d92ac608af8efbcb00a7a3a3f9570..87116c2a8e9c26de3b74099af0e9f62b05879da7 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:`); }