From 72d8e21866e80ee2407422bc85e2b3858daf59fa Mon Sep 17 00:00:00 2001
From: Pregmodder <pregmodder@gmail.com>
Date: Mon, 20 Feb 2023 23:33:34 -0500
Subject: [PATCH] apply revision

---
 src/endWeek/player/prPregnancy.js | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/endWeek/player/prPregnancy.js b/src/endWeek/player/prPregnancy.js
index 6511fbc8fd7..7e8ac6f35a9 100644
--- a/src/endWeek/player/prPregnancy.js
+++ b/src/endWeek/player/prPregnancy.js
@@ -515,16 +515,16 @@ App.EndWeek.Player.pregnancy = function(PC = V.PC) {
 				return weight;
 			};
 
-			let dadHash;
+			let eligibleSlaves;
 			if (V.policies.sexualOpenness === 1) {
-				dadHash = V.slaves.filter(s => canImpreg(V.PC, s) && App.Utils.sexAllowed(V.PC, s) && isSlaveAvailable(s) && canAchieveErection(s) && s.devotion > 20 && raceIsAcceptable);
+				eligibleSlaves = V.slaves.filter(s => canImpreg(V.PC, s) && App.Utils.sexAllowed(V.PC, s) && isSlaveAvailable(s) && canAchieveErection(s) && s.devotion > 20 && raceIsAcceptable);
 			} else {
-				dadHash = V.slaves.filter(s => canImpreg(V.PC, s) && isSlaveAvailable(s) && s.toyHole === "dick");
+				eligibleSlaves = V.slaves.filter(s => canImpreg(V.PC, s) && isSlaveAvailable(s) && s.toyHole === "dick");
 			}
-			dadHash.reduce((acc, cur) => Object.assign(acc, {[cur.ID]: score(cur)}), {});
-			const chosenDadID = hashChoice(dadHash);
-			if (chosenDadID) {
-				tryKnockMeUp(PC, 100, 2, getSlave(chosenDadID));
+			const dadHash = eligibleSlaves.reduce((acc, cur, i) => Object.assign(acc, {[i]: score(cur)}), {});
+			const chosenDadIndex = hashChoice(dadHash);
+			if (chosenDadIndex) {
+				tryKnockMeUp(PC, 100, 2, eligibleSlaves[chosenDadIndex]);
 			}
 		}
 		if (canGetPregnant(PC) && !onBedRest(PC, true) && !isPCCareerInCategory("servant")) {
-- 
GitLab