From 9b3c8983c28888af45d89ebd35deadb83aaaad61 Mon Sep 17 00:00:00 2001
From: kopareigns <kopareigns@gmail.com>
Date: Thu, 27 Sep 2018 19:20:33 -0400
Subject: [PATCH] sanityCheck

---
 devNotes/twine JS.txt                              | 2 +-
 src/cheats/PCCheatMenuCheatDatatypeCleanup.tw      | 2 +-
 src/cheats/mod_EditArcologyCheatDatatypeCleanup.tw | 2 +-
 src/cheats/mod_EditSlaveCheatDatatypeCleanupNew.tw | 2 +-
 src/pregmod/SecForceEX/JS.js                       | 2 +-
 src/pregmod/SecForceEX/Upgrades.tw                 | 2 +-
 src/uncategorized/seRaidingAssault.tw              | 2 +-
 src/uncategorized/storyCaption.tw                  | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt
index 8ba014c97ab..9e544123b38 100644
--- a/devNotes/twine JS.txt	
+++ b/devNotes/twine JS.txt	
@@ -30765,7 +30765,7 @@ window.Firebase = function() {
 		if (V.terrain === "oceanic") garage += ` for inter-arcology travel`;}
 	if (S.Firebase >= 2) barracks = `A barracks has been constructed near the armory, allowing soldiers a quieter place to sleep and store their personal spoils.`, drone = `, as well as a facility for the storage, maintenance, and deployment of armed combat drones.`;
 	if (S.Firebase >= 3) appear = `has become more permanent.`, barracks = `A command center has been constructed near the barracks and armory, allowing for additional support personnel.`;
-	if (S.Firebase >= 4) hangar = `Hangar space for storing and repairing aircraft has has been converted from unused space on the other side of the garage.`;
+	if (S.Firebase >= 4) hangar = `Hangar space for storing and repairing aircraft has been converted from unused space on the other side of the garage.`;
 	if (S.Firebase >= 5) {
 		appear = `is nearing the appearance of a military base.`, launch = `The rest of the firebase has been designated for special projects.`, artillery = `Artillery batteries are set around the base of the arcology.`;
 		if (V.terrain === "oceanic" || V.terrain === "marine") launch += ` A Naval Yard has been constructed in the waters near the arcology.`;}
diff --git a/src/cheats/PCCheatMenuCheatDatatypeCleanup.tw b/src/cheats/PCCheatMenuCheatDatatypeCleanup.tw
index 745aa833e23..ce3f062ab0d 100644
--- a/src/cheats/PCCheatMenuCheatDatatypeCleanup.tw
+++ b/src/cheats/PCCheatMenuCheatDatatypeCleanup.tw
@@ -8,7 +8,7 @@
 <</if>>
 
 <<if $customEvalCode>>
-	<<if $customEvalCode.charAt(0) != "(">>
+	<<if $customEvalCode.charAt(0) != "(" || $nextLink == ")">> /* second condition is only there for sanityCheck */
 		<<set $customEvalCode = "(" + $customEvalCode + ")">>	
 	<</if>>
 	<<if typeof eval($customEvalCode) === "function">>
diff --git a/src/cheats/mod_EditArcologyCheatDatatypeCleanup.tw b/src/cheats/mod_EditArcologyCheatDatatypeCleanup.tw
index 19a9987a726..86030bf4e5a 100644
--- a/src/cheats/mod_EditArcologyCheatDatatypeCleanup.tw
+++ b/src/cheats/mod_EditArcologyCheatDatatypeCleanup.tw
@@ -3,7 +3,7 @@
 <<set $nextButton = "Continue", $nextLink = "Manage Arcology">>
 
 <<if $customEvalCode>>
-	<<if $customEvalCode.charAt(0) != "(">>
+	<<if $customEvalCode.charAt(0) != "(" || $nextLink == ")">> /* second condition is only there for sanityCheck */
 		<<set $customEvalCode = "(" + $customEvalCode + ")">>	
 	<</if>>
 	<<if typeof eval($customEvalCode) === "function">>
diff --git a/src/cheats/mod_EditSlaveCheatDatatypeCleanupNew.tw b/src/cheats/mod_EditSlaveCheatDatatypeCleanupNew.tw
index 2c4f5ed6e4e..a31408fbd3b 100644
--- a/src/cheats/mod_EditSlaveCheatDatatypeCleanupNew.tw
+++ b/src/cheats/mod_EditSlaveCheatDatatypeCleanupNew.tw
@@ -8,7 +8,7 @@
 <</if>>
 
 <<if $customEvalCode>>
-	<<if $customEvalCode.charAt(0) != "(">>
+	<<if $customEvalCode.charAt(0) != "(" || $nextLink == ")">> /* second condition is only there for sanityCheck */
 		<<set $customEvalCode = "(" + $customEvalCode + ")">>	
 	<</if>>
 	<<if typeof eval($customEvalCode) === "function">>
diff --git a/src/pregmod/SecForceEX/JS.js b/src/pregmod/SecForceEX/JS.js
index 68a7c265c0a..28ddef9246c 100644
--- a/src/pregmod/SecForceEX/JS.js
+++ b/src/pregmod/SecForceEX/JS.js
@@ -80,7 +80,7 @@ window.Firebase = function() {
 		if (V.terrain === "oceanic") garage += ` for inter-arcology travel`;}
 	if (S.Firebase >= 2) barracks = `A barracks has been constructed near the armory, allowing soldiers a quieter place to sleep and store their personal spoils.`, drone = `, as well as a facility for the storage, maintenance, and deployment of armed combat drones.`;
 	if (S.Firebase >= 3) appear = `has become more permanent.`, barracks = `A command center has been constructed near the barracks and armory, allowing for additional support personnel.`;
-	if (S.Firebase >= 4) hangar = `Hangar space for storing and repairing aircraft has has been converted from unused space on the other side of the garage.`;
+	if (S.Firebase >= 4) hangar = `Hangar space for storing and repairing aircraft has been converted from unused space on the other side of the garage.`;
 	if (S.Firebase >= 5) {
 		appear = `is nearing the appearance of a military base.`, launch = `The rest of the firebase has been designated for special projects.`, artillery = `Artillery batteries are set around the base of the arcology.`;
 		if (V.terrain === "oceanic" || V.terrain === "marine") launch += ` A Naval Yard has been constructed in the waters near the arcology.`;}
diff --git a/src/pregmod/SecForceEX/Upgrades.tw b/src/pregmod/SecForceEX/Upgrades.tw
index f1b5a49979a..2f362621e0d 100644
--- a/src/pregmod/SecForceEX/Upgrades.tw
+++ b/src/pregmod/SecForceEX/Upgrades.tw
@@ -120,7 +120,7 @@
 	
 				<<if $cash >= _cTV>>
 	
-					<<link "Upgrade Transport Vehicle Fleet">><<set $SF.U = 1, $SFUnit.TV++, $cash -= _cAV)>><<goto "Firebase">><</link>>
+					<<link "Upgrade Transport Vehicle Fleet">><<set $SF.U = 1, $SFUnit.TV++, $cash -= _cTV>><<goto "Firebase">><</link>>
 	
 				<<else>>//Cannot afford to upgrade Transport Vehicle Fleet.//<</if>>
 	
diff --git a/src/uncategorized/seRaidingAssault.tw b/src/uncategorized/seRaidingAssault.tw
index c4a01255cce..853a8476a8c 100644
--- a/src/uncategorized/seRaidingAssault.tw
+++ b/src/uncategorized/seRaidingAssault.tw
@@ -5,7 +5,7 @@ You make your selection and direct your $mercenariesTitle to attack the target.
 <<set _MercCaptureL = -4,_MercCaptureU = 4>>
 <<set _raidescapeL = 1,_raidescapeU = 3>>
 
-<<if $SF.Toggle && $SF.Active >= 1
+<<if $SF.Toggle && $SF.Active >= 1>>
  <<if $SFUnit.Satellite >= 1 && $SatLaunched > 0>>
 		<<set _MercCaptureL += 1,_MercCaptureU +1>>
 		<<set _raidescapeL -= 1,_raidescapeU -= 1>>
diff --git a/src/uncategorized/storyCaption.tw b/src/uncategorized/storyCaption.tw
index aa8ddda322d..d575b8ad993 100644
--- a/src/uncategorized/storyCaption.tw
+++ b/src/uncategorized/storyCaption.tw
@@ -654,7 +654,7 @@
 	<<textarea "_customEvalCode" "">>
 	<<link "Run Custom Function">>
 		<<if _customEvalCode>>
-			<<if _customEvalCode.charAt(0) != "(">>
+			<<if _customEvalCode.charAt(0) != "(" || $nextLink == ")">> /* second condition is only there for sanityCheck */
 				<<set _customEvalCode = "(" + _customEvalCode + ")">>	
 			<</if>>
 			<<if typeof eval(_customEvalCode) === "function">>
-- 
GitLab