From eb225721b1da1ba9e11a670b8f91dc05b8fc76cc Mon Sep 17 00:00:00 2001
From: DCoded <dcoded@live.com>
Date: Thu, 21 Mar 2019 16:47:22 -0400
Subject: [PATCH] Removed legacy code

---
 src/uncategorized/endWeek.tw | 81 +++++++-----------------------------
 1 file changed, 15 insertions(+), 66 deletions(-)

diff --git a/src/uncategorized/endWeek.tw b/src/uncategorized/endWeek.tw
index a8f593053d0..e66d3f0d7e8 100644
--- a/src/uncategorized/endWeek.tw
+++ b/src/uncategorized/endWeek.tw
@@ -42,20 +42,6 @@
 	s.lastWeeksRepIncome = 0;
 	s.lastWeeksRepExpenses = 0;
 })>>
-/*
-<<for _i = 0; _i < $slaves.length; _i++>>
-	<<if $slaves[_i].inflationMethod == 1 || $slaves[_i].inflationMethod == 2>>
-		<<if $slaves[_i].inflationType == "milk">>
-			<<set $inflatedSlavesMilk++>>
-		<<elseif $slaves[_i].inflationType == "cum">>
-			<<set $inflatedSlavesCum++>>
-		<</if>>
-	<</if>>
-	<<if $slaves[_i].assignment == "be a subordinate slave" && $slaves[_i].subTarget == 0>>
-		<<set $subSlaves++>>
-	<</if>>
-<</for>>
-*/
 
 <<if $organs.length > 0>>
 <<run $organs.forEach(function(o) {
@@ -69,24 +55,8 @@
 		}
 	}
 })>>
-/*
-<<for _i = 0; _i < $organs.length; _i++>>
-	<<if $organs[_i].weeksToCompletion > 0>>
-		<<if $organFarmUpgrade == 3>>
-			<<set $organs[_i].weeksToCompletion -= 4>>
-		<<elseif $organFarmUpgrade == 2>>
-			<<set $organs[_i].weeksToCompletion -= 2>>
-		<<else>>
-			<<set $organs[_i].weeksToCompletion-->>
-		<</if>>
-	<</if>>
-	<<if $organs[_i].weeksToCompletion <= 0>>
-		<<set $completedOrgans.push($organs[_i])>>
-		<<set $organs.deleteAt(_i)>>
-	<</if>>
-<</for>>
-*/
 <</if>>
+
 <<if $incubatorOrgans.length > 0>>
 <<run $incubatorOrgans.forEach(function(io) {
 	if ($incubatorOrgans[io].weeksToCompletion > 0) {
@@ -99,35 +69,24 @@
 		}
 	}
 })>>
-/*
-<<for _i = 0; _i < $incubatorOrgans.length; _i++>>
-	<<if $incubatorOrgans[_i].weeksToCompletion > 0>>
-		<<if $organFarmUpgrade == 3>>
-			<<set $incubatorOrgans[_i].weeksToCompletion -= 4>>
-		<<elseif $organFarmUpgrade == 2>>
-			<<set $incubatorOrgans[_i].weeksToCompletion -= 2>>
-		<<else>>
-			<<set $incubatorOrgans[_i].weeksToCompletion-->>
-		<</if>>
-	<</if>>
-<</for>>
-*/
 <</if>>
-/*	for future use
+
+/* for potential future use
 <<if $nurseryOrgans.length > 0>>
-<<for _i = 0; _i < $nurseryOrgans.length; _i++>>
-	<<if $nurseryOrgans[_i].weeksToCompletion > 0>>
-		<<if $organFarmUpgrade == 3>>
-			<<set $nurseryOrgans[_i].weeksToCompletion -= 4>>
-		<<elseif $organFarmUpgrade == 2>>
-			<<set $nurseryOrgans[_i].weeksToCompletion -= 2>>
-		<<else>>
-			<<set $nurseryOrgans[_i].weeksToCompletion-->>
-		<</if>>
-	<</if>>
-<</for>>
+<<run $nurseryOrgans.forEach(function(no) {
+	if ($nurseryOrgans[no].weeksToCompletion > 0) {
+		if ($organFarmUpgrade == 3) {
+			$nurseryOrgans[no].weeksToCompletion -= 4;
+		} else if ($organFarmUpgrade == 2) {
+			$nurseryOrgans[no].weeksToCompletion -= 2;
+		} else {
+			$nurseryOrgans[no].weeksToCompletion--;
+		}
+	}
+})>>
 <</if>>
 */
+
 <<if $limbs.length > 0>>
 <<run $limbs.forEach(function(l) {
 	if ($limbs[l].weeksToCompletion > 0) {
@@ -137,16 +96,6 @@
 		$limbsCompleted++;
 	}
 })>>
-/*
-<<for _i = 0; _i < $limbs.length; _i++>>
-	<<if $limbs[_i].weeksToCompletion > 0>>
-		<<set $limbs[_i].weeksToCompletion-->>
-	<</if>>
-	<<if $limbs[_i].weeksToCompletion == 0>>
-		<<set $limbsCompleted++>>
-	<</if>>
-<</for>>
-*/
 <</if>>
 
 /% Begin section: ensure minimum age is set (game may have been loaded from a non-modded version). %/
-- 
GitLab