From 30fb39349f9edb7893a7d1554f556e428bc1b937 Mon Sep 17 00:00:00 2001
From: lowercase-donkey <lowercasedonkey@gmail.com>
Date: Fri, 26 Jul 2019 13:33:58 -0400
Subject: [PATCH] improve doc

---
 src/js/DefaultRules.js | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js
index 0a6f2fda0e9..7a549a27da9 100644
--- a/src/js/DefaultRules.js
+++ b/src/js/DefaultRules.js
@@ -2851,8 +2851,9 @@ window.DefaultRules = (function() {
 		}
 		if ((rule.autoBrand === 1)) {
 			if ((slave.health > -20)) {
-				if ( /* Normal slave: */ (!slave.amp && slave.earShape !== "none") || /* Amputated slave, but we're branding something else: */ (slave.amp && !["ankles", "calves", "thighs", "feet", "hands", "lower arms", "upper arms", "wrists"].includes(rule.brandTarget)) || /* earless slave, but we are branding something else */ (slave.earShape === "none" && rule.brandTarget !== "ears")) {
-					/* Left/Right section. */
+				if (slave.earShape === "none" && rule.brandTarget !== "ears") {
+
+					// Brand location needs to be split into a left and right
 					if (["ankles", "calves", "feet", "hands", "lower arms", "shoulders", "upper arms", "wrists", "cheeks", "ears", "buttocks", "breasts"].includes(rule.brandTarget)) {
 						let left;
 						let right;
@@ -2901,6 +2902,8 @@ window.DefaultRules = (function() {
 						} else if (rule.brandDesign !== slave.brand[right]) {
 							brandPlace = "right";
 						}
+
+						// Check for amputations:
 						if (["upper arms", "lower arms", "wrists", "hands"].includes(rule.brandTarget)) {
 							// Arms
 							if (!hasLimb(slave, "left arm") && !hasLimb(slave, "right arm")) {
@@ -2936,6 +2939,8 @@ window.DefaultRules = (function() {
 								}
 							}
 						}
+
+						// Apply brands:
 						if (["left", "right"].includes(brandPlace)) {
 							if (slave.devotion < 18) {
 								slave.devotion -= 5;
@@ -2959,6 +2964,8 @@ window.DefaultRules = (function() {
 							slave.health -= 20;
 							r += `<br>${slave.slaveName} has been branded on both ${rule.brandTarget}, with <span class="gold">fear</span>${slave.devotion < 18 ? `, <span class="mediumorchid">regard,</span>` : ``} and <span class="red">health</span> consequences.`;
 						}
+
+					// Brand location does NOT need to be split into a left and right, (and may or may not contain left OR right already.)
 					} else if (slave.brand[rule.brandTarget] !== rule.brandDesign) {
 						if (
 							(!hasLimb(slave, "left arm") && ["left upper arm", "left lower arm", "left wrist", "left hand"].includes(rule.brandTarget)) ||
-- 
GitLab