From 466571de1845d78f690a3bdb71f6539f003089e5 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Tue, 7 Jul 2020 13:15:46 -0700
Subject: [PATCH] Fix some secExp settings that don't survive BC

---
 src/Mods/SecExp/js/secExp.js | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/Mods/SecExp/js/secExp.js b/src/Mods/SecExp/js/secExp.js
index d58a4381715..ad1c54f0f63 100644
--- a/src/Mods/SecExp/js/secExp.js
+++ b/src/Mods/SecExp/js/secExp.js
@@ -436,7 +436,9 @@ App.SecExp.Check = (function() {
 			}
 
 			V.SecExp.settings.battle = V.SecExp.settings.battle || {};
-			V.SecExp.settings.battle.enabled = V.SecExp.settings.battle.enabled || 1;
+			if (!jsDef(V.SecExp.settings.battle.enabled)) {
+				V.SecExp.settings.battle.enabled = 1;
+			}
 			if (jsDef(V.battlesEnabled)) {
 				V.SecExp.settings.battle.enabled = V.battlesEnabled;
 			}
@@ -460,7 +462,9 @@ App.SecExp.Check = (function() {
 
 			V.SecExp.settings.unitDescriptions = V.SecExp.settings.unitDescriptions || 0;
 
-			V.SecExp.settings.battle.allowSlavePrestige = V.SecExp.settings.battle.allowSlavePrestige || 1;
+			if (!jsDef(V.SecExp.settings.battle.allowSlavePrestige)) {
+				V.SecExp.settings.battle.allowSlavePrestige = 1;
+			}
 			if (jsDef(V.allowPrestigeFromBattles)) {
 				V.SecExp.settings.battle.allowSlavePrestige = V.allowPrestigeFromBattles;
 			}
@@ -470,7 +474,9 @@ App.SecExp.Check = (function() {
 				V.SecExp.settings.battle.major.enabled = V.majorBattlesEnabled;
 			}
 
-			V.SecExp.settings.battle.major.gameOver = V.SecExp.settings.battle.major.gameOver || 1;
+			if (!jsDef(V.SecExp.settings.battle.major.gameOver)) {
+				V.SecExp.settings.battle.major.gameOver = 1;
+			}
 			if (jsDef(V.majorBattleGameOver)) {
 				V.SecExp.settings.battle.major.gameOver = V.majorBattleGameOver;
 			}
@@ -481,7 +487,9 @@ App.SecExp.Check = (function() {
 			V.SecExp.settings.battle.major.mult = V.SecExp.settings.battle.major.mult || 1;
 
 			V.SecExp.settings.rebellion = V.SecExp.settings.rebellion || {};
-			V.SecExp.settings.rebellion.enabled = V.SecExp.settings.rebellion.enabled || 1;
+			if (!jsDef(V.SecExp.settings.rebellion.enabled)) {
+				V.SecExp.settings.rebellion.enabled = 1;
+			}
 			if (jsDef(V.rebellionsEnabled)) {
 				V.SecExp.settings.rebellion.enabled = V.rebellionsEnabled;
 			}
@@ -490,7 +498,9 @@ App.SecExp.Check = (function() {
 			if (jsDef(V.forceRebellion)) {
 				V.SecExp.settings.rebellion.force = V.forceRebellion;
 			}
-			V.SecExp.settings.rebellion.gameOver = V.SecExp.settings.rebellion.gameOver || 1;
+			if (!jsDef(V.SecExp.settings.rebellion.gameOver)) {
+				V.SecExp.settings.rebellion.gameOver = 1;
+			}
 			if (jsDef(V.rebellionGameOver)) {
 				V.SecExp.settings.rebellion.gameOver = V.rebellionGameOver;
 			}
-- 
GitLab