From 7c53b2bca186bbcc58d4180ecd2fd6bd906a28d8 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Wed, 25 Mar 2020 14:53:08 -0400
Subject: [PATCH] fix arc undefined

---
 src/init/storyInit.tw | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw
index 7c49a48fc38..243578a2187 100644
--- a/src/init/storyInit.tw
+++ b/src/init/storyInit.tw
@@ -12,6 +12,12 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
 You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
 
+<<if def $arcologies && def $arcologies[0] && def $arcologies[0].prosperity>>
+	<<set _prosperity = (250*$arcologies[0].prosperity*$arcologies[0].ownership)>>
+<<else>>
+	<<set _prosperity = 0>>
+<</if>>
+
 /* Set up the game as politely as possible.  If values are already set, they are preserved. */
 <<run App.Update.setNonexistantProperties(V, App.Data.defaultGameStateVariables)>>
 
@@ -38,9 +44,7 @@ You should have received a copy of the GNU General Public License along with thi
 <<else>> /* imported save (NG+) */
 
 	<<if $freshPC == 0>>
-		<<if def $arcologies[0].prosperity>>
-			<<run cashX((250*$arcologies[0].prosperity*$arcologies[0].ownership), "personalBusiness")>>
-		<</if>>
+		<<run cashX(_prosperity, "personalBusiness")>>
 		<<set _cash = $cash, $cash = 0, $cashLastWeek = 0>>
 		<<run cashX((Math.clamp(1000*Math.trunc(_cash/100000), 5000, 1000000)), "personalBusiness")>>
 		<<if $retainCareer == 0>>
-- 
GitLab