From 919b0078c2200b1d2e6b91857bec1f33f9f98ba5 Mon Sep 17 00:00:00 2001
From: kopareigns <kopareigns@gmail.com>
Date: Mon, 16 Apr 2018 19:13:13 -0400
Subject: [PATCH] slaveIndices Conversion

---
 src/uncategorized/hgApplication.tw           |  3 +--
 src/uncategorized/hgSelect.tw                |  3 +--
 src/uncategorized/longSlaveDescription.tw    | 22 +++++++--------
 src/uncategorized/main.tw                    | 28 +++++++++-----------
 src/uncategorized/masterSuiteReport.tw       |  6 ++---
 src/uncategorized/matchmaking.tw             |  3 +--
 src/uncategorized/neighborsDevelopment.tw    |  4 +--
 src/uncategorized/newSlaveIntro.tw           |  2 +-
 src/uncategorized/peHeadgirlConcubine.tw     |  4 +--
 src/uncategorized/personalAttentionSelect.tw |  2 +-
 src/uncategorized/seRetirement.tw            |  1 -
 src/utility/descriptionWidgets.tw            | 10 +++----
 12 files changed, 41 insertions(+), 47 deletions(-)

diff --git a/src/uncategorized/hgApplication.tw b/src/uncategorized/hgApplication.tw
index 100219f86fa..eff80d11573 100644
--- a/src/uncategorized/hgApplication.tw
+++ b/src/uncategorized/hgApplication.tw
@@ -386,6 +386,5 @@ In spare moments she teaches $activeSlave.slaveName how to prostitute herself. $
 <</if>>
 <</if>>
 
-<<set _hgtarget = $slaves.findIndex(function(s) { return s.ID == $activeSlave.ID; })>>
-<<set $slaves[_hgtarget] = $activeSlave>> /* save changes */
+<<set $slaves[$slaveIndices[$activeSlave.ID]] = $activeSlave>> /* save changes */
 
diff --git a/src/uncategorized/hgSelect.tw b/src/uncategorized/hgSelect.tw
index 64b7af1253d..2800059da24 100644
--- a/src/uncategorized/hgSelect.tw
+++ b/src/uncategorized/hgSelect.tw
@@ -7,8 +7,7 @@
 
 <<set _HGName = "Your Head Girl">>
 <<if ($HeadGirl != 0)>>
-	<<set _i = $slaves.findIndex(function(s) { return s.ID == $HeadGirl.ID; })>>
-	<<set $HeadGirl = $slaves[_i]>>
+	<<set $HeadGirl = getSlave($HeadGirl.ID)>>
 	<<if $surnameOrder != 1>>
 		<<switch $HeadGirl.nationality>>
 		<<case "Cambodian" "Chinese" "Hungarian" "Japanese" "Korean" "Mongolian" "Taiwanese" "Vietnamese">>
diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw
index 58290ec9b60..b30abea7512 100644
--- a/src/uncategorized/longSlaveDescription.tw
+++ b/src/uncategorized/longSlaveDescription.tw
@@ -88,8 +88,8 @@ is
 <<elseif $eventDescription == 1>>
 	$pronounCap is currently involved in an event, but is assigned to $activeSlave.assignment.
 	<<if $activeSlave.assignment == "be a subordinate slave">>
-		<<set _lsd = $slaves.findIndex(function(s) { return s.ID == $activeSlave.subTarget; })>>
-		<<if _lsd != -1>>
+		<<set _lsd = $slaveIndices[$activeSlave.subTarget]>>
+		<<if def _lsd>>
 			She has been ordered to serve ''@@.pink;<<SlaveFullName $slaves[_lsd]>>@@'' specifically.
 		<</if>>
 	<</if>>
@@ -134,7 +134,7 @@ She comes to you for an inspection
 			from where she was resting after her latest sexually exhausting visit to <<for $i = 0; $i < $arcologies.length; $i++>><<if $arcologies[$i].direction == $arcologies[0].influenceTarget>>$arcologies[$i].name<<break>><</if>><</for>>.
 		<</if>>
 	<</if>>
-<<case"be your Head Girl">>
+<<case "be your Head Girl">>
 	with updates on your other slaves ready for your review.
 <<default>>
 	as quickly as she can.
@@ -196,8 +196,8 @@ She comes to you for an inspection
 <<elseif $activeSlave.relationship == -2>>
 	She is @@.lightgreen;emotionally bound to you;@@ her feelings for you are comparable to those in a healthy, loving relationship.
 <<elseif $activeSlave.relationship != 0>>
-<<set _lsd = $slaves.findIndex(function(s) { return s.ID == $activeSlave.relationshipTarget; })>>
-<<if _lsd != -1>>
+<<set _lsd = $slaveIndices[$activeSlave.relationshipTarget]>>
+<<if def _lsd>>
 	She is
 	<<if $activeSlave.relationship <= 1>>
 		''@@.lightgreen;friends with <<SlaveFullName $slaves[_lsd]>>;@@'' the rules <<if $activeSlave.relationshipRules != "restrictive">>encourage<<else>> discourage<</if>> their relationship.
@@ -1095,7 +1095,7 @@ when a dick is pushed inside <<if $activeSlave.vagina >= -1>>either of its lower
 <<Family>>
 
 <<if $activeSlave.relationship >= 3 && totalRelatives($activeSlave) > 0>>
-	<<set _lover = $slaves.find(function(s) { return s.ID == $activeSlave.relationshipTarget; })>>
+	<<set _lover = getSlave($activeSlave.relationshipTarget)>>
 	<<if def _lover>>
 		<<if $activeSlave.mother == _lover.ID>>
 			$pronounCap is in an @@.lightgreen;incestuous relationship with $possessive mother, <<SlaveFullName _lover>>.@@
@@ -1151,8 +1151,8 @@ when a dick is pushed inside <<if $activeSlave.vagina >= -1>>either of its lower
 <<else>>
 
 <<if $activeSlave.relation != 0>>
-	<<set _lsd = $slaves.findIndex(function(s) { return s.ID == $activeSlave.relationTarget; })>>
-	<<if _lsd != -1>>
+	<<set _lsd = $slaveIndices[$activeSlave.relationTarget]>>
+	<<if def _lsd>>
 		<<if ($slaves[_lsd].ID == $activeSlave.relationshipTarget) && ($activeSlave.relationship >= 3)>>
 			$pronounCap is @@.lightgreen;<<SlaveFullName $slaves[_lsd]>>'s $activeSlave.relation, making their relationship incestuous.@@
 		<<else>>
@@ -1164,8 +1164,8 @@ when a dick is pushed inside <<if $activeSlave.vagina >= -1>>either of its lower
 <</if>> /* closes extended family mode */
 
 <<if $activeSlave.rivalry != 0>>
-	<<set _lsd = $slaves.findIndex(function(s) { return s.ID == $activeSlave.rivalryTarget; })>>
-	<<if _lsd != -1>>
+	<<set _lsd = $slaveIndices[$activeSlave.rivalryTarget]>>
+	<<if def _lsd>>
 		$pronounCap
 		<<if $activeSlave.rivalry <= 1>>
 			@@.lightsalmon;dislikes@@ <<SlaveFullName $slaves[_lsd]>>.
@@ -1876,7 +1876,7 @@ She has an easily visible scar on her face that stands out thanks to the oil.
 */
 
 <<if ($activeSlave.ID == $Bodyguard.ID) && ($activeSlave.scars > 1) && ($activeSlave.scars < 6)>>
-Her scars make her look even more menacing that she actually was.
+Her scars make her look even more menacing than she actually is.
 <<elseif ($activeSlave.ID == $Bodyguard.ID) && ($activeSlave.scars == 6)>>
 Her menacing scar makes her look terrifying.
 <<elseif ($activeSlave.ID == $Wardeness.ID) && ($activeSlave.scars > 1)>>
diff --git a/src/uncategorized/main.tw b/src/uncategorized/main.tw
index 5a8beb734bc..613304717cf 100644
--- a/src/uncategorized/main.tw
+++ b/src/uncategorized/main.tw
@@ -42,14 +42,14 @@
 	$slavesVisible = _visibleSlaves.length,
 	$dormitoryPopulation = _visibleSlaves.filter(s => s.livingRules != "luxurious").length,
 	$roomsPopulation = $slavesVisible - $dormitoryPopulation - _visibleSlaves.filter(s => s.livingRules == "luxurious" && s.relationship >= 4).length * 0.5,
-	_PA = (Array.isArray($personalAttention) ? $personalAttention.map(function(x) { return $slaves.find(function(s) { return s.ID == x.ID; }); }) : []),
-	_HG = $slaves.findIndex(s => s.ID == $HeadGirl.ID),
-	_RC = $slaves.findIndex(s => s.ID == $Recruiter.ID),
-	_BG = $slaves.findIndex(s => s.ID == $Bodyguard.ID)>>
+	_PA = (Array.isArray($personalAttention) ? $personalAttention.map(function(x) { return getSlave(x.ID); }) : []),
+	_HG = $slaveIndices[$HeadGirl.ID],
+	_RC = $slaveIndices[$Recruiter.ID],
+	_BG = $slaveIndices[$Bodyguard.ID]>>
 
-<<if (_HG > -1 && $HGSuite > 0)>><<set $slavesVisible++>><</if>>
+<<if (def _HG && $HGSuite > 0)>><<set $slavesVisible++>><</if>>
 <<if ($HGSuiteSlaves > 0)>><<set $slavesVisible++>><</if>>
-<<if (_BG > -1 && $dojo > 1)>><<set $slavesVisible++>><</if>>
+<<if (def _BG && $dojo > 1)>><<set $slavesVisible++>><</if>>
 
 
 <<set $nextButton = "END WEEK", $nextLink = "End Week", $showEncyclopedia = 1, $encyclopedia = "How to Play">>
@@ -141,18 +141,18 @@ __''MAIN MENU''__&nbsp;&nbsp;&nbsp;&nbsp;//[[Summary Options]]//
 	<div id="overview" class="tabcontent">
 		<div class="content">
 			<<set $slaveAssignmentTab = "overview">>			
-			<<if _HG > -1>>
+			<<if def _HG>>
 				''__@@.pink;<<SlaveFullName $HeadGirl>>@@__'' is <<if ndef $headGirlFocus>>serving as your head girl<<if $arcologies[0].FSEgyptianRevivalistLaw == 1>> and Consort<</if>>.<<else>>your head girl<<if $arcologies[0].FSEgyptianRevivalistLaw == 1>> and Consort,<</if>> and is focusing on your slaves' $headGirlFocus.<</if>>
 				<span id="manageHG"><strong><<link "Manage Head Girl">><<goto "HG Select">><</link>></strong></span> @@.cyan;[H]@@
 				<<set $showOneSlave = "Head Girl">>
 				<<include "Slave Summary">>
-			<<elseif (_HG == -1) && ($slaves.length > 1)>>
+			<<elseif (ndef _HG) && ($slaves.length > 1)>>
 				You have @@.red;not@@ selected a Head Girl<<if $arcologies[0].FSEgyptianRevivalistLaw == 1>> and Consort<</if>>. <span id="manageHG"><strong><<link "Select one">><<goto "HG Select">><</link>></strong></span> @@.cyan;[H]@@
-			<<elseif (_HG == -1)>>
+			<<elseif (ndef _HG)>>
 				//You do not have enough slaves to keep a Head Girl//
 			<</if>>
 			<br><br>
-			<<if _RC > -1>>
+			<<if def _RC>>
 				''__@@.pink;<<SlaveFullName $Recruiter>>@@__'' is working
 				<<if $recruiterTarget != "other arcologies">>
 					to recruit girls.
@@ -173,7 +173,7 @@ __''MAIN MENU''__&nbsp;&nbsp;&nbsp;&nbsp;//[[Summary Options]]//
 			<</if>>
 			<<if ($dojo != 0)>>
 				<br><br>
-				<<if _BG > -1>>
+				<<if def _BG>>
 					''__@@.pink;<<SlaveFullName $Bodyguard>>@@__'' is serving as your bodyguard. <span id="manageBG"><strong><<link "Manage Bodyguard">><<goto "BG Select">><</link>></strong></span> @@.cyan;[B]@@
 					<<set $showOneSlave = "guard you">>
 					<<include "Slave Summary">>
@@ -182,8 +182,7 @@ __''MAIN MENU''__&nbsp;&nbsp;&nbsp;&nbsp;//[[Summary Options]]//
 				<</if>>
 					
 				/* Start Italic event text */
-				<<if (_BG > -1) && ($slaves[_BG].assignment == "guard you")>>
-					<<set $i = _BG>>
+				<<if (def _BG) && ($slaves[_BG].assignment == "guard you")>>
 					<<set _GO = "idiot ball">>
 					<br><<include "Use Guard">>
 					<br>&nbsp;&nbsp;&nbsp;&nbsp;<<print "[[Use her mouth|FLips][$activeSlave = $slaves["+_BG+"], $nextButton = _j, $nextLink = _k, $returnTo = _l]]">>
@@ -509,8 +508,7 @@ Filter by assignment: |
 <</for>>
 <</if>>
 
-<<if (_BG > -1) && ($slaves[_BG].assignment == "guard you") && ($useSlaveSummaryOverviewTab != 1)>>
-	<<set $i = _BG>>
+<<if (def _BG) && ($slaves[_BG].assignment == "guard you") && ($useSlaveSummaryOverviewTab != 1)>>
 	<<set _GO = "idiot ball">>
 	<br><<include "Use Guard">>
 	<br>&nbsp;&nbsp;&nbsp;&nbsp;<<print "[[Use her mouth|FLips][$activeSlave = $slaves["+_BG+"], $nextButton = _j, $nextLink = _k, $returnTo = _l]]">>
diff --git a/src/uncategorized/masterSuiteReport.tw b/src/uncategorized/masterSuiteReport.tw
index 58cb55c4c01..c4c0b5d34ff 100644
--- a/src/uncategorized/masterSuiteReport.tw
+++ b/src/uncategorized/masterSuiteReport.tw
@@ -3,9 +3,9 @@
 <<SlaveSort $MastSiIDs>>
 <<set _DL = $MastSiIDs.length, $masterSuiteSlaves = _DL, _SL = $slaves.length, $legendaryAbolitionistID = 0, $masterSuiteAverageEnergy = 0, _masterSuiteAverageCum = 0, _masterSuiteAverageDick = 0, _masterSuiteAverageDom = 0, _masterSuiteAverageMilk = 0, _masterSuiteAveragePreg = 0, _masterSuiteAverageSadism = 0, _masterSuitePregnantSlaves = 0, _masterSuitePregnantSlavesMultiple = 0>>
 <<if $Concubine != 0>>
-	<<set _FLs = $slaves.findIndex(function(s) { return s.ID == $Concubine.ID; })>>
+	<<set _FLs = $slaveIndices[$Concubine.ID]>>
 
-	<<if _FLs != -1>>
+	<<if def _FLs>>
 		/% Add the Concubine to the $MastSiIDs list at the front of the array, so that she displays first %/
 		<<set $MastSiIDs.unshift($Concubine.ID), _DL++>>
 	<</if>>
@@ -381,7 +381,7 @@
 
 	<</for>>
 
-	<<if $Concubine != 0 && _FLs != -1>>
+	<<if $Concubine != 0 && def _FLs>>
 		/% Remove the Concubine from the $MastSiIDs list %/
 		<<set $Concubine = $slaves[_FLs], _dump = $MastSiIDs.deleteAt(0), _DL-->>
 	<</if>>
diff --git a/src/uncategorized/matchmaking.tw b/src/uncategorized/matchmaking.tw
index 95abd5e9dbc..f07ba4adfd0 100644
--- a/src/uncategorized/matchmaking.tw
+++ b/src/uncategorized/matchmaking.tw
@@ -520,8 +520,7 @@ Being ordered into a relationship would be difficult for anyone, but they're so
 <<set $eventSlave.relationshipTarget = $subSlave.ID>>
 <<set $eventSlave.devotion -= 20>>
 
-<<set _i = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-<<set $slaves[_i] = $subSlave>>
+<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 
 <<set $activeSlave = $eventSlave>>
 
diff --git a/src/uncategorized/neighborsDevelopment.tw b/src/uncategorized/neighborsDevelopment.tw
index 3ff1e4860dc..0443de36509 100644
--- a/src/uncategorized/neighborsDevelopment.tw
+++ b/src/uncategorized/neighborsDevelopment.tw
@@ -50,8 +50,8 @@
 <<for _k = 0; _k < $leaders.length; _k++>>
 <<if $leaders[_k].ID == $arcologies[$i].leaderID>>
 	is being run by your agent @@.deeppink;<<SlaveFullName $leaders[_k]>>@@.
-	<<set _agentIndex = $slaves.findIndex(function(s) { return s.ID == $leaders[_k].ID; })>>
-	<<if _agentIndex != -1 && $slaves[_agentIndex].assignment != "be your agent">>
+	<<set _agentIndex = $slaveIndices[$leaders[_k].ID]>>
+	<<if def _agentIndex && $slaves[_agentIndex].assignment != "be your agent">>
 		@@.red;BUG: $slaves[_agentIndex].slaveName also was <<print $slaves[_agentIndex].assignment>>!@@
 		<<assignJob $slaves[_agentIndex] "be your agent">>
 	<</if>>
diff --git a/src/uncategorized/newSlaveIntro.tw b/src/uncategorized/newSlaveIntro.tw
index c4efb2f39b3..85daf0a8cda 100644
--- a/src/uncategorized/newSlaveIntro.tw
+++ b/src/uncategorized/newSlaveIntro.tw
@@ -901,7 +901,7 @@ The legalities completed, ''__@@.pink;<<SlaveFullName $activeSlave>>@@__'' <<if
 	<br>&nbsp;&nbsp;&nbsp;&nbsp;
 	<<link "Use her mother as an example">>
 		<<set _motherID = $activeSlave.ID - 1000>>
-		<<set $recruiterMother = $slaves.find(function(s) { return s.ID == _motherID; })>>
+		<<set $recruiterMother = getSlave(_motherID)>>
 		<<replace "#introResult">>
 			You gesture towards $recruiterMother.slaveName. She is <<if $recruiterMother.intelligence > 0>>bright enough<<elseif (($recruiterMother.vaginalSkill + $recruiterMother.analSkill + $recruiterMother.oralSkill) > 100)>>skilled enough<<else>>obedient enough<</if>> to understand you mean a demonstration is in order. $recruiterMother.slaveName starts things off with a <<if $recruiterMother.entertainSkill >= 100>>masterful<<elseif $recruiterMother.entertainSkill > 10>>skillful<<else>>passable<</if>> striptease, culminating in <<if ($recruiterMother.anus > 0) && ($recruiterMother.fetish != "cumslut")>>bending over<<else>>kneeling<</if>> in front of you. She eagerly moans as you enter her, begging for your seed<<if $recruiterMother.energy > 95>> like the slut she is.<<elseif $recruiterMother.whoreSkill > 30>> like the whore she is<<elseif ($recruiterMother.assignment == "serve in the master suite") || ($recruiterMother.assignment == "please you")>> like the fucktoy she is<</if>>. As you finish, she <<if $recruiterMother.fetish == "cumslut">>opens her mouth and savors your gift, thanking you once she's swallowed enough to be able to talk again.<<elseif ($recruiterMother.fetish == "buttslut") || ($recruiterMother.fetish == "submissive")>>collapses on the floor with her ass high in the air, thanking you for painting her hole white.<<else>>thanks you.<</if>> witnessing this display of servitude from her mother @@.hotpink;eases $activeSlave.slaveName into her new life,@@ and @@.mediumaquamarine;gives her hope@@ she can find a place here.
 		<</replace>>
diff --git a/src/uncategorized/peHeadgirlConcubine.tw b/src/uncategorized/peHeadgirlConcubine.tw
index 76282948cfa..a5d5e2d2263 100644
--- a/src/uncategorized/peHeadgirlConcubine.tw
+++ b/src/uncategorized/peHeadgirlConcubine.tw
@@ -2,8 +2,8 @@
 
 <<set $nextButton = "Continue", $nextLink = "RIE Eligibility Check", $returnTo = "RIE Eligibility Check">>
 
-<<set $i = $slaves.findIndex(function(s) { return s.ID == $HeadGirl.ID; })>>
-<<set $partner = $slaves.findIndex(function(s) { return s.ID == $Concubine.ID; })>>
+<<set $i = $slaveIndices[$HeadGirl.ID]>>
+<<set $partner = $slaveIndices[$Concubine.ID]>>
 
 You wake up one morning to find $HeadGirl.slaveName and $Concubine.slaveName waiting next to your bed. It's immediately obvious that they both have a minor item of business for you, since nothing was urgent enough to wake you early, and they evidently both came in to catch you at your normal hour of rising. They're kneeling side by side next to the bed<<if $HeadGirl.boobs + $Concubine.boobs > 10000>> (a position that smashes their massive breasts together on one side)<<elseif $HeadGirl.butt + $Concubine.butt > 10>> (a position that smashes their massive asses together on one side)<</if>>, and it's also obvious that they've been filling the few minutes they've been waiting for you to wake up by making out. Their lips are moist, $Concubine.slaveName's $Concubine.skin cheeks are a little flushed, and there's even a little unnoticed strand of saliva running from her mouth to $HeadGirl.slaveName's. They both look at you expectantly, wondering whether to speak up or save their questions for after you take a moment to get ready for your day.
 
diff --git a/src/uncategorized/personalAttentionSelect.tw b/src/uncategorized/personalAttentionSelect.tw
index 0cd2d949898..65b16ec46bc 100644
--- a/src/uncategorized/personalAttentionSelect.tw
+++ b/src/uncategorized/personalAttentionSelect.tw
@@ -161,7 +161,7 @@
 	<</if>>
 
 	<<for _i = 0; _i < $personalAttention.length; _i++>>
-		<<set $activeSlave = $slaves.find(s => s.ID == $personalAttention[_i].ID)>>
+		<<set $activeSlave = getSlave($personalAttention[_i].ID)>>
 		/* duplicate check - should not happen if slaveSummary is doing its job */
 		<<if $personalAttention.map(function(s) { return s.ID; }).count($activeSlave.ID) > 1>>
 			<<set $personalAttention.deleteAt(_i), $personalAttention.deleteAt(_i), _i-->>
diff --git a/src/uncategorized/seRetirement.tw b/src/uncategorized/seRetirement.tw
index 66d1ca8b649..37484861292 100644
--- a/src/uncategorized/seRetirement.tw
+++ b/src/uncategorized/seRetirement.tw
@@ -206,7 +206,6 @@ in a way that will inevitably fill the rest of your property with @@.gold;fear.@
 	<<set _sr = $slaveIndices[$activeSlave.relationshipTarget]>>
 	$slaves[_sr].slaveName, for her part, is @@.mediumorchid;horrified.@@
 	<<set $slaves[_sr].devotion -= 20>>
-<</for>>
 <</if>>
 <br><br>
 
diff --git a/src/utility/descriptionWidgets.tw b/src/utility/descriptionWidgets.tw
index 519ee037a5e..c2dca8b4c9d 100644
--- a/src/utility/descriptionWidgets.tw
+++ b/src/utility/descriptionWidgets.tw
@@ -37,16 +37,16 @@
 
 <<if $useSlaveSummaryOverviewTab != 1>> /* Hide this block if it will be shown on the overview tab */
 	<br>
-	<<if _HG > -1>>
+	<<if def _HG>>
 		''__@@.pink;<<SlaveFullName $HeadGirl>>@@__'' is <<if ndef $headGirlFocus>>serving as your head girl<<if $arcologies[0].FSEgyptianRevivalistLaw == 1>> and Consort<</if>>.<<else>>your head girl<<if $arcologies[0].FSEgyptianRevivalistLaw == 1>> and Consort,<</if>> and is focusing on your slaves' $headGirlFocus.<</if>>
 		<span id="manageHG"><strong><<link "Manage Head Girl">><<goto "HG Select">><</link>></strong></span> @@.cyan;[H]@@
-	<<elseif (_HG == -1) && ($slaves.length > 1)>>
+	<<elseif (ndef _HG) && ($slaves.length > 1)>>
 		You have not selected a Head Girl<<if $arcologies[0].FSEgyptianRevivalistLaw == 1>> and Consort<</if>>. <span id="manageHG"><strong><<link "Select one">><<goto "HG Select">><</link>></strong></span> @@.cyan;[H]@@
-	<<elseif (_HG == -1)>>
+	<<elseif (ndef _HG)>>
 		//You do not have enough slaves to keep a Head Girl//
 	<</if>>
 	<br>
-	<<if _RC > -1>>
+	<<if def _RC>>
 		''__@@.pink;<<SlaveFullName $Recruiter>>@@__'' is working to recruit girls.
 		<span id="manageRecruiter"><strong><<link "Manage Recruiter">><<goto "Recruiter Select">><</link>></strong></span> @@.cyan;[U]@@
 	<<else>>
@@ -55,7 +55,7 @@
 	<</if>>
 	<<if ($dojo != 0)>>
 		<br>
-		<<if _BG > -1>>
+		<<if def _BG>>
 			''__@@.pink;<<SlaveFullName $Bodyguard>>@@__'' is serving as your bodyguard. <span id="manageBG"><strong><<link "Manage Bodyguard">><<goto "BG Select">><</link>></strong></span> @@.cyan;[B]@@
 		<<else>>
 			You have not selected a Bodyguard. <span id="manageBG"><strong><<link "Select one">><<goto "BG Select">><</link>></strong></span> @@.cyan;[B]@@
-- 
GitLab