From 75c85f60f38df180259f99c1edf8e8096920ee6c Mon Sep 17 00:00:00 2001
From: corncobman21 <corncobman21@hotmail.com>
Date: Wed, 27 Dec 2017 21:30:59 -0500
Subject: [PATCH] Random relation as JS function

---
 src/uncategorized/walkPast.tw | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/uncategorized/walkPast.tw b/src/uncategorized/walkPast.tw
index 4403b52b0b6..23e10210513 100644
--- a/src/uncategorized/walkPast.tw
+++ b/src/uncategorized/walkPast.tw
@@ -3,8 +3,7 @@
 //
 <<set $target = "">>
 <<if $familyTesting == 1 && totalRelatives($activeSlave) > 0 && random(1,100) > 80>>
-	<<set $relations = $slaves.filter(function(s) { return areSisters($activeSlave, s) > 0 || s.mother == $activeSlave.ID || s.father == $activeSlave.ID || s.ID == $activeSlave.mother || s.ID == $activeSlave.father; })>>
-	<<set $relation = $relations.random()>>
+    <<set $relation = getRandomRelation($activeSlave)>>
 	<<if $relation.mother == $activeSlave.ID || $relation.father == $activeSlave.ID>>
 		<<set $relationType = "daughter">>
 	<<elseif $activeSlave.mother == $relation.ID>>
-- 
GitLab