From f846b44f1d83e5d18a4c20057d44024eacd2bd22 Mon Sep 17 00:00:00 2001
From: lowercase-donkey <lowercasedonkey@gmail.com>
Date: Thu, 29 Aug 2019 07:37:18 -0400
Subject: [PATCH] fix assign

---
 src/004-base/facility.js | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/004-base/facility.js b/src/004-base/facility.js
index 2887fe9fcc6..83936e6e826 100644
--- a/src/004-base/facility.js
+++ b/src/004-base/facility.js
@@ -331,7 +331,34 @@ App.Entity.Facilities.Facility = class {
 	/** Number of already hosted slaves
 	 * @returns {number} */
 	get hostedSlaves() {
-		return State.variables[this.desc.baseName + "Slaves"];
+		switch (this.desc.baseName) {
+			case "brothel":
+				return State.variables.BrothiIDs.length;
+			case "arcade":
+				return State.variables.ArcadeiIDs.length;
+			case "cellblock":
+				return State.variables.CellBiIDs.length;
+			case "clinic":
+				return State.variables.CliniciIDs.length;
+			case "club":
+				return State.variables.ClubiIDs.length;
+			case "dairy":
+				return State.variables.DairyiIDs.length;
+			case "farmyard":
+				return State.variables.FarmyardiIDs.length;
+			case "HGSuite":
+				return State.variables.HGSuiteiIDs.length;
+			case "masterSuite":
+				return State.variables.MastSiIDs.length;
+			case "servantsQuarters":
+				return State.variables.ServQiIDs.length;
+			case "spa":
+				return State.variables.SpaiIDs.length;
+			case "nursery":
+				return State.variables.NurseryiIDs.length;
+			default:
+				return 0;
+		}
 	}
 
 	get hasFreeSpace() {
-- 
GitLab