From 502ed112ce8dbfaae15c7121848825dddd52a1f1 Mon Sep 17 00:00:00 2001
From: Arkerthan <arkerthan@gmail.com>
Date: Mon, 9 Sep 2019 13:05:47 +0200
Subject: [PATCH] cleanup

---
 devNotes/Useful JS Function Documentation.txt |  8 +++++++-
 src/js/descriptionWidgets.js                  | 18 +++++++++---------
 src/js/slaveStatsChecker.js                   |  2 +-
 3 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/devNotes/Useful JS Function Documentation.txt b/devNotes/Useful JS Function Documentation.txt
index a5d9dba0246..7982ad97554 100644
--- a/devNotes/Useful JS Function Documentation.txt	
+++ b/devNotes/Useful JS Function Documentation.txt	
@@ -257,6 +257,12 @@ SkillIncrease.Whore(slave, value)
 SkillIncrease.Entertain(slave, value)
 - Increases the slave's skill by value or 1. Returns a string if the skill is boosted over a threshold.
 
+surgeryAmp(slave, part) - Clean up variables connected to a specific body part that was amputated. For limbs see below.
+
+removeLimbs(slave, limb) - Remove limb(s) and clean up connected variables.
+attachLimbs(slave, limb, id) - Attach limb(s). Expects amputated limbs, will overwrite existing.
+- limb can be: "left arm", "right arm", "left leg", "right leg", "all"
+
 UtilJS [script]
 	Height.mean(nationality, race, genes, age) - returns the mean height for the given combination and age in years (>=2).
  Height.mean(nationality, race, genes) - returns the mean adult height for the given combination.
@@ -376,4 +382,4 @@ UtilJS [script]
 
 	jsNdef - A .js port of sugarcube's ndef.
 
-	jsDef - A .js port of sugarcube's def.
\ No newline at end of file
+	jsDef - A .js port of sugarcube's def.
diff --git a/src/js/descriptionWidgets.js b/src/js/descriptionWidgets.js
index 0cbaf2e237d..a4adfbb7fbe 100644
--- a/src/js/descriptionWidgets.js
+++ b/src/js/descriptionWidgets.js
@@ -1024,21 +1024,21 @@ App.Desc.limbs = function(slave) {
 	} else if (getLeftArmID(slave) === getRightArmID(slave) &&
 			getLeftArmID(slave) === getLeftLegID(slave) &&
 			getLeftArmID(slave) === getRightLegID(slave)) {
-		r += `${He} has ` + idToDescription(getLeftArmID(slave)) + ` limbs`;
+		r += `${He} has ${idToDescription(getLeftArmID(slave))} limbs`;
 	} else {
 		if (!hasAnyArms(slave)) {
 			r += `Both of ${his} arms have been amputated`;
 		} else if (!hasBothArms(slave)) {
 			if (hasLeftArm(slave)) {
-				r += `${He} has ` + addA(idToDescription(getLeftArmID(slave))) + ` left arm, but ${his} right has been amputated,`;
+				r += `${He} has ${addA(idToDescription(getLeftArmID(slave)))} left arm, but ${his} right has been amputated,`;
 			} else {
-				r += `${He} has ` + addA(idToDescription(getRightArmID(slave))) + ` right arm, but ${his} left has been amputated,`;
+				r += `${He} has ${addA(idToDescription(getRightArmID(slave)))} right arm, but ${his} left has been amputated,`;
 			}
 		} else {
 			if (getLeftArmID(slave) === getRightArmID(slave)) {
-				r += `${He} has ` + idToDescription(getLeftArmID(slave)) + ` arms`;
+				r += `${He} has ${idToDescription(getLeftArmID(slave))} arms`;
 			} else {
-				r += `${His} has ` + addA(idToDescription(getRightArmID(slave))) + ` right arm, but ` + addA(idToDescription(getLeftArmID(slave))) + ` left arm`;
+				r += `${He} has ${addA(idToDescription(getRightArmID(slave)))} right arm, but ${addA(idToDescription(getLeftArmID(slave)))} left arm`;
 			}
 		}
 		r += ` and `;
@@ -1046,15 +1046,15 @@ App.Desc.limbs = function(slave) {
 			r += `Both of ${his} legs have been amputated`;
 		} else if (!hasBothLegs(slave)) {
 			if (hasLeftLeg(slave)) {
-				r += `${he} has ` + addA(idToDescription(getLeftLegID(slave))) + ` left leg, but ${his} right has been amputated`;
+				r += `${he} has ${addA(idToDescription(getLeftLegID(slave)))} left leg, but ${his} right has been amputated`;
 			} else {
-				r += `${he} has ` + addA(idToDescription(getRightLegID(slave))) + ` right leg, but ${his} left has been amputated`;
+				r += `${he} has ${addA(idToDescription(getRightLegID(slave)))} right leg, but ${his} left has been amputated`;
 			}
 		} else {
 			if (getLeftLegID(slave) === getRightLegID(slave)) {
-				r += `${he} has ` + idToDescription(getLeftLegID(slave)) + ` legs`;
+				r += `${he} has ${idToDescription(getLeftLegID(slave))} legs`;
 			} else {
-				r += `${his} has ` + addA(idToDescription(getRightLegID(slave))) + ` right leg, but ` + addA(idToDescription(getLeftLegID(slave))) + ` left leg`;
+				r += `${he} has ${addA(idToDescription(getRightLegID(slave)))} right leg, but ${addA(idToDescription(getLeftLegID(slave)))} left leg`;
 			}
 		}
 	}
diff --git a/src/js/slaveStatsChecker.js b/src/js/slaveStatsChecker.js
index a7067d1c535..3da8b90f0fd 100644
--- a/src/js/slaveStatsChecker.js
+++ b/src/js/slaveStatsChecker.js
@@ -646,7 +646,7 @@ window.canWalk = function(slave) {
 		return false;
 	} else if (tooBigBelly(slave)) {
 		return false;
-	} else if (slave.heels === 1 && !(slave.shoes === "heels" || slave.shoes === "extreme heels" || slave.shoes === "boots")) {
+	} else if (slave.heels === 1 && setup.highHeels.includes(slave.shoes)) {
 		return false;
 	}
 	return true;
-- 
GitLab