diff --git a/src/Mods/SecExp/js/buildingsJS.js b/src/Mods/SecExp/js/buildingsJS.js index 505208bf5a8933d1ba861c1935e1adf1da0cdd7a..0b6650b04f058adb136337d1e9d8847fcdd34d67 100644 --- a/src/Mods/SecExp/js/buildingsJS.js +++ b/src/Mods/SecExp/js/buildingsJS.js @@ -294,7 +294,7 @@ App.SecExp.weapManu = (function() { Init:Init, BC:BC }; - + function Init() { V.SecExp.buildings.weapManu = { menials: 0, @@ -353,7 +353,7 @@ App.SecExp.weapManu = (function() { V.SecExp.buildings.weapManu.upgrades.human.morale = V.SecExp.buildings.weapManu.upgrades.human.morale || 0; V.SecExp.buildings.weapManu.upgrades.current = V.SecExp.buildings.weapManu.upgrades.current || {time: 0}; - if (V.currentUpgrade) { + if (jsDef(V.currentUpgrade)) { V.SecExp.buildings.weapManu.upgrades.current = {ID: V.currentUpgrade.ID, time: V.currentUpgrade.time}; } } diff --git a/src/Mods/SecExp/js/secExp.js b/src/Mods/SecExp/js/secExp.js index c035d0501039da78b0c417c3182c138018118cde..25a3d310cd57f339adbe56e2a192712163f74031 100644 --- a/src/Mods/SecExp/js/secExp.js +++ b/src/Mods/SecExp/js/secExp.js @@ -56,9 +56,9 @@ App.SecExp.generalInit = function(){ allowSlavePrestige: 1, force: 0, showStats: 0, + frequency: 1, major: { enabled: 0, - frequency: 1, gameOver: 1, mult: 1, force: 0 @@ -91,6 +91,7 @@ App.SecExp.generalInit = function(){ waterway: 0 }, units: { + bots: {}, slaves: { created: 0, casualties: 0, @@ -150,9 +151,7 @@ App.SecExp.generalInit = function(){ pharaonTradition: 0, } }, - smilingMan: { - progress : 0, - } + smilingMan: { progress : 0 } }); App.SecExp.initTrade(); diff --git a/src/Mods/SecExp/js/secExpBC.js b/src/Mods/SecExp/js/secExpBC.js index d6dddc8d68c99d196618ddfd52c5aea33ee7a161..8884e43a3ef66354761d58724b8b9c021c3ff30d 100644 --- a/src/Mods/SecExp/js/secExpBC.js +++ b/src/Mods/SecExp/js/secExpBC.js @@ -80,8 +80,8 @@ App.SecExp.generalBC = function() { active: V.secBots.active || V.arcologyUpgrade.drones > 0 ? 1 : 0, ID: -1, isDeployed: V.secBots.isDeployed || 0, - troops: Math.max(V.secBots.troops, V.arcologyUpgrade.drones > 0 ? 30 : 0), - maxTroops: Math.max(V.secBots.maxTroops, V.arcologyUpgrade.drones > 0 ? 30 : 0) + troops: Math.max(V.secBots.troops || 0, V.arcologyUpgrade.drones > 0 ? 30 : 0), + maxTroops: Math.max(V.secBots.maxTroops || 0, V.arcologyUpgrade.drones > 0 ? 30 : 0) }); /* if (V.secBots) { V.SecExp.units.bots = V.secBots; @@ -161,7 +161,7 @@ App.SecExp.generalBC = function() { V.SecExp.core.security = V.SecExp.security.cap; delete V.SecExp.security; } - V.SecExp.core.totalKills = V.SecExp.core.totalKills || V.totalKills || 0; + V.SecExp.core.totalKills = +V.SecExp.core.totalKills || V.totalKills || 0; if (V.week === 1 || !jsDef(V.SecExp.core.crimeLow)) { V.SecExp.core.crimeLow = 30; @@ -306,37 +306,25 @@ App.SecExp.generalBC = function() { /* V.SecExp.rebellions.repairTime = V.SecExp.rebellions.repairTime || {}; V.SecExp.rebellions.repairTime.waterway = V.SecExp.rebellions.repairTime.waterway || 0; - if (V.garrison && V.garrison.waterwayTime) { - V.SecExp.rebellions.repairTime.waterway = V.garrison.waterwayTime; - } V.SecExp.rebellions.repairTime.assistant = V.SecExp.rebellions.repairTime.assistant || 0; - if (V.garrison && V.garrison.assistantTime) { - V.SecExp.rebellions.repairTime.assistant = V.garrison.assistantTime; - } V.SecExp.rebellions.repairTime.reactor = V.SecExp.rebellions.repairTime.reactor || 0; - if (V.garrison && V.garrison.reactorTime) { - V.SecExp.rebellions.repairTime.reactor = V.garrison.reactorTime; - } V.SecExp.rebellions.repairTime.arc = V.SecExp.rebellions.repairTime.arc || 0; - if (V.arcRepairTime) { + if (jsDef(V.garrison)) { + V.SecExp.rebellions.repairTime.waterway = V.garrison.waterwayTime; + V.SecExp.rebellions.repairTime.assistant = V.garrison.assistantTime; + V.SecExp.rebellions.repairTime.reactor = V.garrison.reactorTime; V.SecExp.rebellions.repairTime.arc = V.arcRepairTime; } V.SecExp.rebellions.garrison = V.SecExp.rebellions.garrison || {}; V.SecExp.rebellions.garrison.penthouse = V.SecExp.rebellions.garrison.penthouse || 0; - if (V.garrison && V.garrison.penthouse) { - V.SecExp.rebellions.garrison.penthouse = V.garrison.penthouse; - } V.SecExp.rebellions.garrison.reactor = V.SecExp.rebellions.garrison.reactor || 0; - if (V.garrison && V.garrison.reactor) { - V.SecExp.rebellions.garrison.reactor = V.garrison.reactor; - } V.SecExp.rebellions.garrison.assistant = V.SecExp.rebellions.garrison.assistant || 0; - if (V.garrison && V.garrison.assistant) { - V.SecExp.rebellions.garrison.assistant = V.garrison.assistant; - } V.SecExp.rebellions.garrison.waterway = V.SecExp.rebellions.garrison.waterway || 0; - if (V.garrison && V.garrison.waterway) { + if (jsDef(V.garrison)) { + V.SecExp.rebellions.garrison.penthouse = V.garrison.penthouse; + V.SecExp.rebellions.garrison.reactor = V.garrison.reactor; + V.SecExp.rebellions.garrison.assistant = V.garrison.assistant; V.SecExp.rebellions.garrison.waterway = V.garrison.waterway; } */ diff --git a/src/Mods/SecExp/widgets/miscSecExpWidgets.tw b/src/Mods/SecExp/widgets/miscSecExpWidgets.tw index 23f8b40b0e77037329060c751cf29dd2282e3aad..f2e993457f03834f477748497bd40754410bd13d 100644 --- a/src/Mods/SecExp/widgets/miscSecExpWidgets.tw +++ b/src/Mods/SecExp/widgets/miscSecExpWidgets.tw @@ -1,9 +1,6 @@ :: miscSecExpWidgets [widget nobr] <<widget "fixBrokenStats">> - <<if !Number.isInteger($SecExp.core.totalKills)>> - <<set $SecExp.core.totalKills = 0>> - <</if>> <<if !Number.isInteger($mercTotalCasualties)>> <<set $mercTotalCasualties = 0>> <</if>>