From 892f522074341a66d27a7525ecee7e39938eba65 Mon Sep 17 00:00:00 2001
From: kopareigns <kopareigns@gmail.com>
Date: Tue, 15 May 2018 23:33:13 -0400
Subject: [PATCH] tweaks

---
 src/debugging/debugWidgets.tw        |  4 +--
 src/uncategorized/saRelationships.tw | 46 +++++++++++++---------------
 src/uncategorized/storyCaption.tw    |  4 +--
 3 files changed, 26 insertions(+), 28 deletions(-)

diff --git a/src/debugging/debugWidgets.tw b/src/debugging/debugWidgets.tw
index cdb886b95f9..e8abc812f99 100644
--- a/src/debugging/debugWidgets.tw
+++ b/src/debugging/debugWidgets.tw
@@ -15,7 +15,7 @@ The included "Go Back" link is intended to replace the usual NextButton.
 <<link "Go Back">>
 	<<script>>
 		Engine.backward(); /* Moves the save state one state backwards. */
-		var newestHistory = State.history.pop(); /* Removes the latest save state. Necessary to allow the option of displaying the changed variables again immediately without screwing everything up. */
+		State.history.splice(-1,1); /* Removes the latest save state. Necessary to allow the option of displaying the changed variables again immediately without screwing everything up. */
 		Config.history.maxStates = 1; /* Reset the max number of states so as not to explode save file sizes. */
 	<</script>>
 <</link>>
@@ -45,7 +45,7 @@ Differences:
 <<link "Go Back">>
 	<<script>>
 		Engine.backward(); /* Moves the save state one state backwards. */
-		var newestHistory = State.history.pop(); /* Removes the latest save state. Necessary to allow the option of displaying the changed variables again immediately without screwing everything up. */
+		State.history.splice(-1,1); /* Removes the latest save state. Necessary to allow the option of displaying the changed variables again immediately without screwing everything up. */
 		Config.history.maxStates = 1; /* Reset the max number of states so as not to explode save file sizes. */
 	<</script>>
 <</link>>
diff --git a/src/uncategorized/saRelationships.tw b/src/uncategorized/saRelationships.tw
index 7f5c825257c..f1738206395 100644
--- a/src/uncategorized/saRelationships.tw
+++ b/src/uncategorized/saRelationships.tw
@@ -208,9 +208,6 @@
 		<<if def _J>>
 			<<set _SlaveJ = $slaves[_J], _SlaveJ.relationshipTarget = _SlaveI.ID, _SlaveJ.relationship = _SlaveI.relationship>>
 		<</if>>
-		<<if _SlaveI.rivalryTarget != _SlaveI.relationTarget>>
-			<<set _K = $slaveIndices[_SlaveI.relationTarget]>>
-		<</if>>
 		<<if (_SlaveI.relationship > 0) && (_SlaveJ == null)>>
 			<br>@@.red;_SlaveI.slaveName's relationship was _SlaveI.relationship and relationshipTarget was _SlaveI.relationshipTarget but no slave with that ID was found@@<br>
 			<<set _SlaveI.relationship = 0, _SlaveI.relationshipTarget = 0>>
@@ -1560,26 +1557,29 @@
 
 	<<else>>
 
-	<<if def _K && _SlaveI.trust <= 95>>
-		_SlaveI.slaveName
-		<<if _SlaveI.trust < -20>>
-			<<if _SlaveI.relation == "mother">>
-				is @@.gold;agonizingly aware@@ that her child $slaves[_K].slaveName is also your slave and might suffer if either of them angers you, and @@.hotpink;does her best@@ to protect her.
-				<<set _SlaveI.trust -= 4, _SlaveI.devotion += 4>>
-			<<else>>
-				is @@.gold;painfully conscious@@ that her <<if _SlaveI.relation == "daughter">>mother<<else>>_SlaveI.relation<</if>> $slaves[_K].slaveName is also your slave and might suffer if either of them displeases you, and @@.hotpink;tries to obey@@ as best she can.
-				<<set _SlaveI.trust -= 2, _SlaveI.devotion += 2>>
-			<</if>>
-		<<else>>
-			knows that her <<if _SlaveI.relation == "mother">>daughter<<elseif _SlaveI.relation == "daughter">>mother<<else>>_SlaveI.relation<</if>> $slaves[_K].slaveName
-			<<if $slaves[_K].devotion > 50>>
-				loves being your sex slave, and is @@.hotpink;happy@@ for her.
-				<<set _SlaveI.devotion += 2>>
-			<<elseif ($slaves[_K].devotion > 20) || ($slaves[_K].trust < -20)>>
-				is an obedient sex slave, and hopes she'll avoid punishment.
+	<<if _SlaveI.rivalryTarget != _SlaveI.relationTarget>>
+		<<set _K = $slaveIndices[_SlaveI.relationTarget]>>
+		<<if def _K && _SlaveI.trust <= 95>>
+			_SlaveI.slaveName
+			<<if _SlaveI.trust < -20>>
+				<<if _SlaveI.relation == "mother">>
+					is @@.gold;agonizingly aware@@ that her child $slaves[_K].slaveName is also your slave and might suffer if either of them angers you, and @@.hotpink;does her best@@ to protect her.
+					<<set _SlaveI.trust -= 4, _SlaveI.devotion += 4>>
+				<<else>>
+					is @@.gold;painfully conscious@@ that her <<if _SlaveI.relation == "daughter">>mother<<else>>_SlaveI.relation<</if>> $slaves[_K].slaveName is also your slave and might suffer if either of them displeases you, and @@.hotpink;tries to obey@@ as best she can.
+					<<set _SlaveI.trust -= 2, _SlaveI.devotion += 2>>
+				<</if>>
 			<<else>>
-				hates being a sex slave, and is @@.gold;afraid@@ for her.
-				<<set _SlaveI.trust -= 2>>
+				knows that her <<if _SlaveI.relation == "mother">>daughter<<elseif _SlaveI.relation == "daughter">>mother<<else>>_SlaveI.relation<</if>> $slaves[_K].slaveName
+				<<if $slaves[_K].devotion > 50>>
+					loves being your sex slave, and is @@.hotpink;happy@@ for her.
+					<<set _SlaveI.devotion += 2>>
+				<<elseif ($slaves[_K].devotion > 20) || ($slaves[_K].trust < -20)>>
+					is an obedient sex slave, and hopes she'll avoid punishment.
+				<<else>>
+					hates being a sex slave, and is @@.gold;afraid@@ for her.
+					<<set _SlaveI.trust -= 2>>
+				<</if>>
 			<</if>>
 		<</if>>
 	<</if>>
@@ -1591,5 +1591,3 @@
 		<<set $slaves[_J] = _SlaveJ>>
 	<</if>>
 <</if>> /% CLOSES FUCKDOLL CHECK %/
-
-<<unset _K>>
diff --git a/src/uncategorized/storyCaption.tw b/src/uncategorized/storyCaption.tw
index de9c70b59d1..b518bdf3721 100644
--- a/src/uncategorized/storyCaption.tw
+++ b/src/uncategorized/storyCaption.tw
@@ -621,12 +621,12 @@
 	<br>
 	<<link "Display Variables">><<checkvars>><</link>>
 	<br>
-	<<link "Bug Report">><<bugreport>><</link>>
-	<br>
 	<<link "Display Changed Variables">>
 		<<set Config.history.maxStates = 2>> /* makes sure we store the current state so we can return to it */
 		<<goto "Variable Difference">>
 	<</link>>
+	<br>
+	<<link "Bug Report">><<bugreport>><</link>>
 <</if>>
 
 <</nobr>>
-- 
GitLab