From 0c0d2bdfcbdbf47b9c22fb8f3f1d045fb7aa4f18 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Wed, 23 Dec 2020 23:50:13 -0800
Subject: [PATCH] Set price floor for whoring at 1.

---
 src/endWeek/saWhore.js | 8 +++-----
 src/js/economyJS.js    | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/endWeek/saWhore.js b/src/endWeek/saWhore.js
index eb44f07b400..e817101e792 100644
--- a/src/endWeek/saWhore.js
+++ b/src/endWeek/saWhore.js
@@ -98,13 +98,11 @@ App.SlaveAssignment.whore = (function() {
 			FuckResult = Math.trunc(slave.sexQuality * App.EndWeek.saVars.whorePriceAdjustment.lowerClass);
 		} else {
 			customers = "ERROR";
-			FuckResult = "ERROR";
+			FuckResult = 1;
 			console.log("Error in effectiveWhoreClass for " + slave.slaveName + ", expected 1-4, got: ", slave.effectiveWhoreClass, "whoreClass:", slave.whoreClass, slave.assignment, slave);
 		}
-		if (FuckResult <= 0) {
-			// Customers always pay at least ¤1
-			FuckResult = beauty;
-		}
+		// Minimum whore cost is 1, regardless of price scaling
+		FuckResult = Math.max(FuckResult, 1);
 	}
 
 	/**
diff --git a/src/js/economyJS.js b/src/js/economyJS.js
index 056ba297b2c..c9598e01078 100644
--- a/src/js/economyJS.js
+++ b/src/js/economyJS.js
@@ -1929,7 +1929,7 @@ globalThis.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDeman
 				income *= healthPenalty(s) / initialHealthPenalty;
 			}
 
-			s.sexQuality = Math.trunc((income * demandBoost * priceBoost) / s.sexAmount);
+			s.sexQuality = Math.max(Math.trunc((income * demandBoost * priceBoost) / s.sexAmount), 1);
 			const incomeBoostCorrected = Math.trunc(s.sexAmount * s.sexQuality / priceBoost);
 			if ((toTheBrothel === 1 || s.assignment === Job.BROTHEL) && V.brothelBoost.eligible > 0) {
 				slaveJobValues.brothel.boost += Math.max(Math.trunc(s.sexAmount * s.sexQuality / demandBoost) - Math.trunc(income), 0); // Keeping track of additional benefits from boosting the brothel on the price side and not the amount side.
-- 
GitLab