From f5451ecdc7fafce3a193ce97e48e19d1512597c5 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Mon, 19 Oct 2020 15:02:50 -0400
Subject: [PATCH] move linkArray to narrower scope

---
 src/facilities/incubator/incubatorInteract.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/facilities/incubator/incubatorInteract.js b/src/facilities/incubator/incubatorInteract.js
index 6b55c73ea32..e2b1eb76400 100644
--- a/src/facilities/incubator/incubatorInteract.js
+++ b/src/facilities/incubator/incubatorInteract.js
@@ -9,7 +9,6 @@ App.UI.incubator = function() {
 	V.reservedChildren = FetusGlobalReserveCount("incubator");
 	V.reservedChildrenNursery = FetusGlobalReserveCount("nursery");
 
-	let linkArray = [];
 	let tankOrgans = {};
 	const el = new DocumentFragment();
 	const _SL = V.slaves.length;
@@ -112,6 +111,7 @@ App.UI.incubator = function() {
 	function mothers() {
 		const el = new DocumentFragment();
 		let r = [];
+		let linkArray;
 		const freeTanks = V.incubator - V.incubatorSlaves;
 		r.push(`Reserve an eligible mother-to-be's child to be placed in a tank upon birth. Of ${V.incubator} tanks, ${freeTanks}`);
 		if (freeTanks === 1) {
@@ -518,6 +518,7 @@ App.UI.incubator = function() {
 	function PC() {
 		const el = new DocumentFragment();
 		let r = [];
+		let linkArray = [];
 		const freeTanks = V.incubator - V.incubatorSlaves;
 		const _WL = V.PC.womb.length;
 		const _reservedIncubator = WombReserveCount(V.PC, "incubator");
@@ -528,7 +529,6 @@ App.UI.incubator = function() {
 		} else {
 			r.push(`${pregNumberName(_WL, 2)}.`);
 		}
-		linkArray = [];
 		const choices = document.createElement("div");
 		choices.classList.add("choices");
 		if (_reservedIncubator > 0) {
@@ -707,6 +707,7 @@ App.UI.incubator = function() {
 	function tankBabies() {
 		const el = new DocumentFragment();
 		let row;
+		let linkArray;
 
 		if (V.incubatorSlaves > 0) {
 			App.UI.DOM.appendNewElement("h2", el, `Children in ${V.incubatorName}`);
-- 
GitLab