From 8424e00607610540bd8613016616625af18f86c6 Mon Sep 17 00:00:00 2001 From: Jones <Jones> Date: Wed, 4 Dec 2019 21:34:30 +0100 Subject: [PATCH] BC fixes --- src/js/datatypeCleanupJS.js | 6 ++++++ src/uncategorized/BackwardsCompatibility.tw | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/src/js/datatypeCleanupJS.js b/src/js/datatypeCleanupJS.js index 3b5ecacbfb3..eccfa425e4f 100644 --- a/src/js/datatypeCleanupJS.js +++ b/src/js/datatypeCleanupJS.js @@ -1724,6 +1724,9 @@ window.EconomyDatatypeCleanup = function EconomyDatatypeCleanup() { V.rentDefaults.upperClass = Math.max(+V.rentDefaults.upperClass, 0) || 180; /* nowhere modified */ V.rentDefaults.topClass = Math.max(+V.rentDefaults.topClass, 0) || 650; /* nowhere modified */ + if (!V.whoreBudget) { + V.whoreBudget = {}; + } if (V.whoreBudget.lowerClass) { V.whoreBudget.lowerClass = Math.max(+V.whoreBudget.lowerClass, 8) || 10; } else { @@ -1744,6 +1747,9 @@ window.EconomyDatatypeCleanup = function EconomyDatatypeCleanup() { } else { V.whoreBudget.topClass = (0.8 + (V.rent.topClass / V.rentDefaults.topClass) / 5) * 1500; } + if (!V.NPCMarketShare) { + V.NPCMarketShare = {}; + } V.NPCMarketShare.lowerClass = Math.clamp(+V.NPCMarketShare.lowerClass, 0, 1000) || 0; V.NPCMarketShare.middleClass = Math.clamp(+V.NPCMarketShare.middleClass, 0, 1000) || 0; V.NPCMarketShare.upperClass = Math.clamp(+V.NPCMarketShare.upperClass, 0, 1000) || 0; diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index 565679e7c9b..fcf2bd5e797 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -3050,6 +3050,9 @@ Setting missing global variables: <<if def $lowerClassSexDemand>> <<unset $lowerClassSexDemand>> <</if>> +<<if ndef $classSatisfied>> + <<set $classSatisfied = {}>> +<</if>> <<if def $lowerClassSatisfied>> <<set $classSatisfied.lowerClass = $lowerClassSatisfied>> <<unset $lowerClassSatisfied>> @@ -3063,10 +3066,16 @@ Setting missing global variables: <<if def $topClassSexDemand>> <<unset $topClassSexDemand>> <</if>> +<<if ndef $sexSubsidies>> + <<set $sexSubsidies = {}>> +<</if>> <<if def $sexSubsidiesLC>> <<set $sexSubsidies.lowerClass = $sexSubsidiesLC>> <<unset $sexSubsidiesLC>> <</if>> +<<if ndef $sexSupplyBarriers>> + <<set $sexSupplyBarriers = {}>> +<</if>> <<if def $sexSupplyBarriersLC>> <<set $sexSupplyBarriers.lowerClass = $sexSupplyBarriersLC>> <<unset $sexSupplyBarriersLC>> -- GitLab