From e2e2ffb6fa3cc156fceecab22dece14b88c8df5d Mon Sep 17 00:00:00 2001
From: kopareigns <kopareigns@gmail.com>
Date: Mon, 23 Apr 2018 19:16:54 -0400
Subject: [PATCH] fixes

---
 src/uncategorized/longSlaveDescription.tw   |  2 +-
 src/uncategorized/saRivalries.tw            | 27 +++++----------------
 src/uncategorized/saServeYourOtherSlaves.tw |  6 ++---
 3 files changed, 10 insertions(+), 25 deletions(-)

diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw
index ef8b1d143de..e0dd6dbb356 100644
--- a/src/uncategorized/longSlaveDescription.tw
+++ b/src/uncategorized/longSlaveDescription.tw
@@ -1886,7 +1886,7 @@ Her scars make her look like she's in the right place.
 <</if>>
 
 <<if $activeSlave.fuckdoll == 0>>
-<<if $activeSlave.markings == "birthmark">>
+<<if $activeSlave.markings == "birthmark" && $activeSlave.prestige == 0>>
   She has a large, liver-colored birthmark, detracting from her beauty.
 <</if>>
 <<if ($activeSlave.skin == "tanned")>>
diff --git a/src/uncategorized/saRivalries.tw b/src/uncategorized/saRivalries.tw
index af09dbdb523..2deba85bcaa 100644
--- a/src/uncategorized/saRivalries.tw
+++ b/src/uncategorized/saRivalries.tw
@@ -133,17 +133,15 @@
 
 <<else>>
 
-<<for _j = 0; _j < _SL; _j++>>
-<<if $slaves[_j].ID == $slaves[$i].rivalryTarget>>
+<<set _j = $slaveIndices[$slaves[$i].rivalryTarget]>>
+<<if def _j>>
 	<<if $slaves[$i].fuckdoll>>
 		$slaves[$i].slaveName is a living sex toy, not a person, it @@.lightsalmon;can't really maintain any meaningful rivalry@@ with <<SlaveFullName $slaves[_j]>>.
 		<<set $slaves[_j].rivalry = 0,$slaves[_j].rivalryTarget = 0, $slaves[$i].rivalry = 0, $slaves[$i].rivalryTarget = 0>>
-		<<break>>
 	<</if>>
 	<<if $slaves[$i].fetish == "mindbroken">>
 		Since $slaves[$i].slaveName is mindbroken, she @@.lightsalmon;can't really maintain any meaningful rivalry@@ with <<SlaveFullName $slaves[_j]>>.
 		<<set $slaves[_j].rivalry = 0,$slaves[_j].rivalryTarget = 0, $slaves[$i].rivalry = 0, $slaves[$i].rivalryTarget = 0>>
-		<<break>>
 	<</if>>
 	<<if $slaves[$i].need>>
 	<<if $universalRulesConsent == 0>>
@@ -177,7 +175,6 @@
 		<<if $slaves[$i].fetishKnown>>
 			$slaves[$i].slaveName and <<SlaveFullName $slaves[_j]>> share sexual interests, and in the sexual atmosphere of the arcology, it's @@.lightgreen;difficult for them to keep up their dislike@@ of one another with the mutual attraction.
 			<<set $slaves[_j].rivalry -= 1, $slaves[$i].rivalry -= 1>>
-			<<break>>
 		<</if>>
 		<</if>>
 		<</if>>
@@ -185,7 +182,6 @@
 		<<if $slaves[$i].relationship > 3>>
 			<<set $slaves[_j].rivalry = 0, $slaves[_j].rivalryTarget = 0>>
 			<<set $slaves[$i].rivalry = 0, $slaves[$i].rivalryTarget = 0>>
-			<<break>>
 		<</if>>
 		<</if>>
 	<<if _roll > 80>>
@@ -193,34 +189,29 @@
 		<<if $slaves[$i].trust < -20>>
 			Since both $slaves[$i].slaveName and <<SlaveFullName $slaves[_j]>> are terrified of you, they work together to @@.lightgreen;get over their feud,@@ since it brings punishment on both of them.
 			<<set $slaves[_j].rivalry -= 1, $slaves[$i].rivalry -= 1>>
-			<<break>>
 		<</if>>
 		<</if>>
 		<<if $slaves[_j].devotion > 50>>
 		<<if $slaves[$i].devotion > 50>>
 			Since both $slaves[$i].slaveName and <<SlaveFullName $slaves[_j]>> are devoted to you, they work together to @@.lightgreen;get over their feud,@@ since it gets in the way of their duties.
 			<<set $slaves[_j].rivalry -= 1, $slaves[$i].rivalry -= 1>>
-			<<break>>
 		<</if>>
 		<</if>>
 	<<if _roll > 90>>
 		<<if $slaves[$i].energy > 95>>
 			$slaves[$i].slaveName lusts after <<SlaveFullName $slaves[_j]>>, and does everything she can to @@.lightgreen;patch up their differences.@@
 			<<set $slaves[_j].rivalry -= 1, $slaves[$i].rivalry -= 1>>
-			<<break>>
 		<</if>>
 		<<if $slaves[$i].attrXX > 85>>
 		<<if ($slaves[_j].vagina > -1) || ($slaves[_j].faceShape != "masculine")>>
 			$slaves[$i].slaveName lusts after <<SlaveFullName $slaves[_j]>>, and does everything she can to @@.lightgreen;patch up their differences.@@
 			<<set $slaves[_j].rivalry -= 1, $slaves[$i].rivalry -= 1>>
-			<<break>>
 		<</if>>
 		<</if>>
 		<<if $slaves[$i].attrXY > 85>>
 		<<if ($slaves[_j].balls > 0) || ($slaves[_j].faceShape == "masculine")>>
 			$slaves[$i].slaveName lusts after <<SlaveFullName $slaves[_j]>>, and does everything she can to @@.lightgreen;patch up their differences.@@
 			<<set $slaves[_j].rivalry -= 1, $slaves[$i].rivalry -= 1>>
-			<<break>>
 		<</if>>
 		<</if>>
 		<<if $slaves[_j].assignment != $slaves[$i].assignment>>
@@ -228,7 +219,6 @@
 		<<if $slaves[_j].subTarget != $slaves[$i].ID>>
 			With time apart $slaves[$i].slaveName and <<SlaveFullName $slaves[_j]>> @@.lightgreen;dislike each other less.@@
 			<<set $slaves[_j].rivalry -= 1, $slaves[$i].rivalry -= 1>>
-			<<break>>
 		<</if>>
 		<</if>>
 		<</if>>
@@ -244,7 +234,6 @@
 				$slaves[$i].slaveName and <<SlaveFullName $slaves[_j]>> @@.lightgreen;patch up their family relationship.@@
 				<<set $slaves[_j].rivalry -= 1, $slaves[$i].rivalry -= 1>>
 			<</if>>
-			<<break>>
 		<</if>>
 	<<else>>
 		<<if $slaves[$i].relation>>
@@ -256,7 +245,6 @@
 				$slaves[$i].slaveName and <<SlaveFullName $slaves[_j]>> @@.lightgreen;patch up their family relationship.@@
 				<<set $slaves[_j].rivalry -= 1, $slaves[$i].rivalry -= 1>>
 			<</if>>
-			<<break>>
 		<</if>>
 		<</if>>
 	<</if>>
@@ -264,25 +252,22 @@
 		<<if  $slaves[$i].rivalry < 3>>
 			$slaves[$i].slaveName @@.lightsalmon;bickers with <<SlaveFullName $slaves[_j]>>@@ whenever she can, worsening their rivalry.
 			<<set $slaves[_j].rivalry += 1, $slaves[$i].rivalry += 1>>
-			<<break>>
 		<</if>>
 	<<elseif _roll < $slaves[$i].devotion-$slaves[$i].trust-10>>
 		$slaves[$i].slaveName does her best to be nice to <<SlaveFullName $slaves[_j]>>, and manages to @@.lightgreen;de-escalate their little feud.@@
 		<<set $slaves[_j].rivalry -= 1, $slaves[$i].rivalry -= 1>>
 		<<break>>
 	<</if>>
-	<<break>>
+<<else>>
+	@@.red;Error, rivalryTarget not found.@@
 <</if>>
-<</for>>
 
 <</if>>
 
 <<if $slaves[$i].rivalry>>
-<<for _j = 0; _j < _SL; _j++>>
-	<<if ($slaves[_j].ID == $slaves[$i].rivalryTarget) && ($slaves[$i].ID != $slaves[_j].rivalryTarget)>>
+<<set _j = $slaveIndices[$slaves[$i].rivalryTarget]>>
+	<<if def _j && ($slaves[$i].ID != $slaves[_j].rivalryTarget)>>
 		<<set $slaves[_j].rivalry = 0, $slaves[_j].rivalryTarget = 0>>
 		<<set $slaves[$i].rivalry = 0, $slaves[$i].rivalryTarget = 0>>
-		<<break>>
 	<</if>>
-<</for>>
 <</if>>
\ No newline at end of file
diff --git a/src/uncategorized/saServeYourOtherSlaves.tw b/src/uncategorized/saServeYourOtherSlaves.tw
index b09a4d414e7..cb9b9176fc0 100644
--- a/src/uncategorized/saServeYourOtherSlaves.tw
+++ b/src/uncategorized/saServeYourOtherSlaves.tw
@@ -52,11 +52,11 @@
 <</if>>
 <<if ($dormitoryPopulation+$roomsPopulation-$subSlaves) > 5>>
 	<<set _load = ($subSlaves/($dormitoryPopulation+$roomsPopulation-$subSlaves))>>
-	<<if _load <= .2>>
+	<<if _load > .8>>
 		Since there are enough other slaves servicing your stock alongside her, she sees limited action.
-	<<elseif _load <= .5>>
+	<<elseif _load > .5>>
 		With her servicing sisters, her workload is reasonable and she isn't overworked.
-	<<elseif _load <= .8>>
+	<<elseif _load > .2>>
 		While she may have support in servicing your stock, she is overwhelmed by their collective need.
 		<<set $slaves[$i].tired = 1>>
 		<<if $slaves[$i].sexualFlaw == "self hating">>
-- 
GitLab