From 2548da0aa6c99b3d2e0482e774c9db519bf28016 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Fri, 22 May 2020 13:12:14 -0700
Subject: [PATCH] Fix agent selection, and mark all facility leader selection
 passages as jump-from-safe.

---
 src/facilities/farmyard/farmerSelect.tw   | 2 +-
 src/facilities/nursery/matronSelect.tw    | 2 +-
 src/npc/agent/agentSelect.tw              | 8 ++++----
 src/npc/agent/agentWorkaround.tw          | 2 +-
 src/uncategorized/attendantSelect.tw      | 2 +-
 src/uncategorized/concubineSelect.tw      | 2 +-
 src/uncategorized/djSelect.tw             | 2 +-
 src/uncategorized/madamSelect.tw          | 2 +-
 src/uncategorized/milkmaidSelect.tw       | 2 +-
 src/uncategorized/nurseSelect.tw          | 2 +-
 src/uncategorized/schoolteacherSelect.tw  | 2 +-
 src/uncategorized/stewardessSelect.tw     | 2 +-
 src/uncategorized/subordinateTargeting.tw | 2 +-
 src/uncategorized/wardenessSelect.tw      | 2 +-
 14 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/facilities/farmyard/farmerSelect.tw b/src/facilities/farmyard/farmerSelect.tw
index aa3f1cdd49c..e94fb005024 100644
--- a/src/facilities/farmyard/farmerSelect.tw
+++ b/src/facilities/farmyard/farmerSelect.tw
@@ -1,4 +1,4 @@
-:: Farmer Select [nobr]
+:: Farmer Select [nobr jump-from-safe]
 
 <<set $nextButton = "Back", $nextLink = "Farmyard", $encyclopedia = "Farmer">>
 <<if ($Farmer != 0)>>
diff --git a/src/facilities/nursery/matronSelect.tw b/src/facilities/nursery/matronSelect.tw
index c761b76cc31..334c05b7a23 100644
--- a/src/facilities/nursery/matronSelect.tw
+++ b/src/facilities/nursery/matronSelect.tw
@@ -1,4 +1,4 @@
-:: Matron Select [nobr]
+:: Matron Select [nobr jump-from-safe]
 
 <<set $nextButton = "Back", $nextLink = "Nursery", $encyclopedia = "Matron">>
 <<if ($Matron != 0)>>
diff --git a/src/npc/agent/agentSelect.tw b/src/npc/agent/agentSelect.tw
index 4b66d67ac28..147416474db 100644
--- a/src/npc/agent/agentSelect.tw
+++ b/src/npc/agent/agentSelect.tw
@@ -1,11 +1,11 @@
-:: Agent Select [nobr]
+:: Agent Select [nobr jump-from-safe]
 
 <<set $nextButton = "Back", $nextLink = "Neighbor Interact", $encyclopedia = "Agents">>
 ''Appoint an Agent from your devoted slaves:''
 
 <<= App.UI.SlaveList.slaveSelectionList(
-		s => (s.fuckdoll === 0 && s.devotion > 20 && s.intelligence + s.intelligenceImplant > 15 && s.intelligenceImplant >= 15 && canWalk(s) && canSee(s) && canHear(s) && canTalk(s) && s.broodmother < 2 && (s.breedingMark !== 1 || State.variables.propOutcome === 0 || State.variables.eugenicsFullControl === 1 || State.variables.arcologies[0].FSRestart === "unset")),
-		(slave, index) => App.UI.DOM.passageLink(SlaveFullName(slave), 'Agent Workaround',
-			() => { variables().i = index; }),
+		s => (s.fuckdoll === 0 && s.devotion > 20 && s.intelligence + s.intelligenceImplant > 15 && s.intelligenceImplant >= 15 && canWalk(s) && canSee(s) && canHear(s) && canTalk(s) && s.broodmother < 2 && (s.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")),
+		(slave) => App.UI.DOM.passageLink(SlaveFullName(slave), 'Agent Workaround',
+			() => { V.i = V.slaves.findIndex((s) => s.ID === slave.ID); }),
 		s => App.Entity.facilities.arcologyAgent.manager.slaveHasExperience(s)
 	)>>
diff --git a/src/npc/agent/agentWorkaround.tw b/src/npc/agent/agentWorkaround.tw
index 47b08f4975a..9a0412913bc 100644
--- a/src/npc/agent/agentWorkaround.tw
+++ b/src/npc/agent/agentWorkaround.tw
@@ -1,4 +1,4 @@
-:: Agent Workaround [nobr]
+:: Agent Workaround [nobr jump-from-safe]
 
 <<set $nextButton = "Continue", $nextLink = "Neighbor Interact">>
 
diff --git a/src/uncategorized/attendantSelect.tw b/src/uncategorized/attendantSelect.tw
index f2a58e2d5de..f6d21e712e5 100644
--- a/src/uncategorized/attendantSelect.tw
+++ b/src/uncategorized/attendantSelect.tw
@@ -1,4 +1,4 @@
-:: Attendant Select [nobr]
+:: Attendant Select [nobr jump-from-safe]
 
 <<set $nextButton = "Back", $nextLink = "Spa", $encyclopedia = "Attendant">>
 <<if _S.Attendant>>
diff --git a/src/uncategorized/concubineSelect.tw b/src/uncategorized/concubineSelect.tw
index 6dc78c2a7c5..4911d97db58 100644
--- a/src/uncategorized/concubineSelect.tw
+++ b/src/uncategorized/concubineSelect.tw
@@ -1,4 +1,4 @@
-:: Concubine Select [nobr]
+:: Concubine Select [nobr jump-from-safe]
 
 <<set $nextButton = "Back", $nextLink = "Master Suite", $encyclopedia = "Concubine">>
 <<if ($Concubine != 0)>>
diff --git a/src/uncategorized/djSelect.tw b/src/uncategorized/djSelect.tw
index 0f8ce2b700b..b96cb766b59 100644
--- a/src/uncategorized/djSelect.tw
+++ b/src/uncategorized/djSelect.tw
@@ -1,4 +1,4 @@
-:: DJ Select [nobr]
+:: DJ Select [nobr jump-from-safe]
 
 <<set $nextButton = "Back", $nextLink = "Club", $encyclopedia = "DJ">>
 <<if ($DJ != 0)>>
diff --git a/src/uncategorized/madamSelect.tw b/src/uncategorized/madamSelect.tw
index da0f7201f29..9ba7e7ef90c 100644
--- a/src/uncategorized/madamSelect.tw
+++ b/src/uncategorized/madamSelect.tw
@@ -1,4 +1,4 @@
-:: Madam Select [nobr]
+:: Madam Select [nobr jump-from-safe]
 
 <<set $nextButton = "Back", $nextLink = "Brothel", $encyclopedia = "Madam">>
 <<if ($Madam != 0)>>
diff --git a/src/uncategorized/milkmaidSelect.tw b/src/uncategorized/milkmaidSelect.tw
index 0422098d463..f10c82b5ebe 100644
--- a/src/uncategorized/milkmaidSelect.tw
+++ b/src/uncategorized/milkmaidSelect.tw
@@ -1,4 +1,4 @@
-:: Milkmaid Select [nobr]
+:: Milkmaid Select [nobr jump-from-safe]
 
 <<set $nextButton = "Back", $nextLink = "Dairy", $encyclopedia = "Milkmaid">>
 <<if ($Milkmaid != 0)>>
diff --git a/src/uncategorized/nurseSelect.tw b/src/uncategorized/nurseSelect.tw
index e5e92cd225f..debce7c0d98 100644
--- a/src/uncategorized/nurseSelect.tw
+++ b/src/uncategorized/nurseSelect.tw
@@ -1,4 +1,4 @@
-:: Nurse Select [nobr]
+:: Nurse Select [nobr jump-from-safe]
 
 <<set $nextButton = "Back", $nextLink = "Clinic", $encyclopedia = "Nurse">>
 <<if ($Nurse != 0)>>
diff --git a/src/uncategorized/schoolteacherSelect.tw b/src/uncategorized/schoolteacherSelect.tw
index 904b0599509..43cb2333611 100644
--- a/src/uncategorized/schoolteacherSelect.tw
+++ b/src/uncategorized/schoolteacherSelect.tw
@@ -1,4 +1,4 @@
-:: Schoolteacher Select [nobr]
+:: Schoolteacher Select [nobr jump-from-safe]
 
 <<set $nextButton = "Back", $nextLink = "Schoolroom", $encyclopedia = "Schoolteacher">>
 <<if ($Schoolteacher != 0)>>
diff --git a/src/uncategorized/stewardessSelect.tw b/src/uncategorized/stewardessSelect.tw
index 112c0ed0da9..8ea988a80db 100644
--- a/src/uncategorized/stewardessSelect.tw
+++ b/src/uncategorized/stewardessSelect.tw
@@ -1,4 +1,4 @@
-:: Stewardess Select [nobr]
+:: Stewardess Select [nobr jump-from-safe]
 
 <<set $nextButton = "Back", $nextLink = "Servants' Quarters", $encyclopedia = "Stewardess">>
 <<if ($Stewardess != 0)>>
diff --git a/src/uncategorized/subordinateTargeting.tw b/src/uncategorized/subordinateTargeting.tw
index ccd8f8edf27..3f47d393205 100644
--- a/src/uncategorized/subordinateTargeting.tw
+++ b/src/uncategorized/subordinateTargeting.tw
@@ -31,7 +31,7 @@
 	<<= App.UI.SlaveList.slaveSelectionList(
 			s => s.devotion >= -20 && s.fuckdoll === 0 && State.variables.activeSlave.ID !== s.ID &&
 				(!isAmputee(State.variables.activeSlave) || !isAmputee(s)),
-			(s, i) => App.UI.DOM.passageLink(SlaveFullName(s), 'Subordinate Targeting', () => { V.activeSlave.subTarget = s.ID; }),
+			(s) => App.UI.DOM.passageLink(SlaveFullName(s), 'Subordinate Targeting', () => { V.activeSlave.subTarget = s.ID; }),
 		)>>
 	<<if $universalRulesImpregnation == "Stud" && $StudID == 0>>
 		<br><br>[[Stud|Subordinate Targeting][$activeSlave.subTarget = -1, $StudID = $activeSlave.ID]]
diff --git a/src/uncategorized/wardenessSelect.tw b/src/uncategorized/wardenessSelect.tw
index 5473502a82e..7180dd34750 100644
--- a/src/uncategorized/wardenessSelect.tw
+++ b/src/uncategorized/wardenessSelect.tw
@@ -1,4 +1,4 @@
-:: Wardeness Select [nobr]
+:: Wardeness Select [nobr jump-from-safe]
 
 <<set $nextButton = "Back", $nextLink = "Cellblock", $encyclopedia = "Wardeness">>
 <<if ($Wardeness != 0)>>
-- 
GitLab