From f3a526cb2dcc7f4f016205f32437cd3b3c25b85e Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Fri, 21 Feb 2020 16:35:03 -0500
Subject: [PATCH] fix chastity

---
 src/js/itemAvailability.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js
index 86634c4914d..546d16e0f1b 100644
--- a/src/js/itemAvailability.js
+++ b/src/js/itemAvailability.js
@@ -288,6 +288,12 @@ window.isClothingAccessible = (function() {
 	}
 
 	function isAvailable(item, category, slave) {
+		if (slave) {
+			let slaveResults = isAvailableForSlave(item, category, slave);
+			if (slaveResults !== true) { // If they are true we pass this check but want to run the others.
+				return slaveResults;
+			}
+		}
 		if (!(item.hasOwnProperty("fs")) && !(item.hasOwnProperty("rs"))) {
 			// No restriction, this clothing item is available to everyone
 			return true;
@@ -346,9 +352,6 @@ window.isClothingAccessible = (function() {
 				return false;
 			}
 		}
-		if (slave) {
-			return isAvailableForSlave(item, category, slave);
-		}
 		return true;
 	}
 
-- 
GitLab