From db775efa87432d83dee9b5d8636d5c7299a9299c Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Sat, 27 Aug 2022 10:57:33 -0400
Subject: [PATCH] Clamp skin stretch scaling at 45 years old.  I'm not
 convinced about the utility of elasticity in this application, but at least
 we can prevent total calcification of elderly slaves, which is clearly wrong.

---
 js/medicine/utility.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/medicine/utility.js b/js/medicine/utility.js
index a7e2ba4d7cd..07682ad63cc 100644
--- a/js/medicine/utility.js
+++ b/js/medicine/utility.js
@@ -29,7 +29,7 @@ App.Medicine.pocketVolume = function() {
 		// now the current skin area:
 		const A = Math.PI * (a * a + h * h);
 
-		const skinStretchFactor = linearInterpolation(Math.max(slave.physicalAge, 13), 13, 1.5, 45, 1.15);
+		const skinStretchFactor = linearInterpolation(Math.clamp(slave.physicalAge, 13, 45), 13, 1.5, 45, 1.15);
 
 		const hMax = Math.sqrt(A * skinStretchFactor / Math.PI - a * a);
 		const VMax = Math.PI / 6 * hMax * (3 * a * a + hMax * hMax);
-- 
GitLab