From aa9e116c37010f50d90b91641e758e2fd03825fb Mon Sep 17 00:00:00 2001
From: Arkerthan <arkerthan@gmail.com>
Date: Tue, 8 Oct 2019 12:49:52 +0200
Subject: [PATCH] correctly clean up limbs

---
 .../mod_EditSlaveCheatDatatypeCleanupNew.tw     | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/cheats/mod_EditSlaveCheatDatatypeCleanupNew.tw b/src/cheats/mod_EditSlaveCheatDatatypeCleanupNew.tw
index 3405ab4b97e..718d50c9194 100644
--- a/src/cheats/mod_EditSlaveCheatDatatypeCleanupNew.tw
+++ b/src/cheats/mod_EditSlaveCheatDatatypeCleanupNew.tw
@@ -108,9 +108,20 @@
 	<<print "Slave has normal limbs, limb interface reset to 0 (no interface)">><br>
 	<<set $tempSlave.PLimb = 0>>
 <</if>>
-<<if ($tempSlave.PLimb == 0) && hasAllProstheticLimbs($tempSlave)>>
-	<<print "Slave has no prosthetic limb interface, remove all limbs">>
-	<<run removeLimbs($tempSlave, "all")>>
+<<if $tempSlave.PLimb === 0 && hasAnyProstheticLimbs($tempSlave)>>
+	<<print "Slave has no prosthetic limb interface, remove all prosthetic limbs">>
+	<<if getLeftArmID($tempSlave) > 1>>
+		<<run removeLimbs($tempSlave, "left arm")>>
+	<</if>>
+	<<if getRightArmID($tempSlave) > 1>>
+		<<run removeLimbs($tempSlave, "right arm")>>
+	<</if>>
+	<<if getLeftLegID($tempSlave) > 1>>
+		<<run removeLimbs($tempSlave, "left leg")>>
+	<</if>>
+	<<if getRightLegID($tempSlave) > 1>>
+		<<run removeLimbs($tempSlave, "right leg")>>
+	<</if>>
 <</if>>
 <<if !hasAnyLegs($tempSlave)>>
 	<<set $tempSlave.heels = 0>>
-- 
GitLab