From a44a55366441380a8477f95c79ab0d9d5bbec653 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Sat, 7 Nov 2020 02:16:24 -0800
Subject: [PATCH] Brothel cleanup

---
 src/endWeek/brothelReport.js | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/endWeek/brothelReport.js b/src/endWeek/brothelReport.js
index cfe0b2bb3d8..b68f82ec895 100644
--- a/src/endWeek/brothelReport.js
+++ b/src/endWeek/brothelReport.js
@@ -1,13 +1,13 @@
 globalThis.brothelReport = function() {
 	const el = document.createElement("p");
-	let His, He, he, him, his, himself, wife;
 	let r;
 
 	const brothelStats = document.createElement("span");
 	el.append(brothelStats);
 
 	const slaves = App.Utils.sortedEmployees(App.Entity.facilities.brothel);
-	let SL = slaves.length, FLsFetish = 0, profits = 0;
+	const SL = slaves.length;
+	let profits = 0;
 	V.legendaryWhoreID = 0;
 	V.legendaryWombID = 0;
 
@@ -18,6 +18,7 @@ globalThis.brothelReport = function() {
 	const brothelNameCaps = capFirstChar(V.brothelName);
 
 	function madamText() {
+		let FLsFetish = 0;
 		let r = [];
 		if (V.MadamID !== 0) {
 			if (S.Madam.health.condition < -80) {
@@ -58,9 +59,9 @@ globalThis.brothelReport = function() {
 			}
 			/* Make sure we have registered living expenses as for any other slave */
 			getSlaveStatisticData(S.Madam, V.facility.brothel);
-			({
+			const {
 				he, him, his, himself, He, His, wife
-			} = getPronouns(S.Madam));
+			} = getPronouns(S.Madam);
 			/* apply following SA passages to facility leader */
 
 			r = [];
@@ -211,9 +212,6 @@ globalThis.brothelReport = function() {
 			}
 
 			if ((SL + V.brothelSlavesGettingHelp < 10) && V.MadamNoSex !== 1 && !slaveResting(S.Madam)) {
-				({
-					he, him, his, himself, He, His, wife
-				} = getPronouns(S.Madam));
 				let oldCash = V.cash;
 				if (V.showEWD !== 0) {
 					App.Events.addParagraph(
@@ -289,9 +287,6 @@ globalThis.brothelReport = function() {
 		}
 		let oldCash = V.cash;
 		for (const slave of slaves) {
-			({
-				he, him, his, himself, He, His, wife
-			} = getPronouns(slave));
 			if ((V.legendaryWombID === 0) && (!isAmputee(slave)) && (slave.preg > slave.pregData.normalBirth / 1.33) && (slave.broodmother === 0) && (slave.eggType === "human") && (slave.counter.births > 10) && (slave.devotion > 50) && (slave.prestige === 0)) {
 				V.legendaryWombID = slave.ID;
 			}
@@ -335,6 +330,7 @@ globalThis.brothelReport = function() {
 			}
 
 			if (V.showEWD !== 0) {
+				const {He} = getPronouns(slave);
 				const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
 				if (V.seeImages && V.seeReportImages) {
 					App.UI.DOM.appendNewElement("div", slaveEntry, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "tinyImg"]);
-- 
GitLab