Avoid crash on double-loading of the mod #252

This commit is contained in:
DanielNoord
2020-12-02 13:26:07 +01:00
committed by GitHub
3 changed files with 36 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
/********** /**********
* Header * * Header *
**********/ **********/
RunCookieMonsterHeader = function() {
CM = {}; CM = {};
CM.Backup = {}; CM.Backup = {};
@@ -17,6 +17,11 @@ CM.Data = {};
CM.Disp = {}; CM.Disp = {};
CM.Sim = {}; CM.Sim = {};
}
if (typeof CM == "undefined") {
RunCookieMonsterHeader();
}
/********* /*********
* Cache * * Cache *
@@ -4598,4 +4603,8 @@ CM.Sim.SellBuildingsForChoEgg = function() {
* Footer * * Footer *
**********/ **********/
if (!CM.isRunning) {
CM.Init(); CM.Init();
CM.isRunning = 1
}

View File

@@ -2,4 +2,8 @@
* Footer * * Footer *
**********/ **********/
if (!CM.isRunning) {
CM.Init(); CM.Init();
CM.isRunning = 1
}

View File

@@ -1,7 +1,7 @@
/********** /**********
* Header * * Header *
**********/ **********/
RunCookieMonsterHeader = function() {
CM = {}; CM = {};
CM.Backup = {}; CM.Backup = {};
@@ -17,4 +17,9 @@ CM.Data = {};
CM.Disp = {}; CM.Disp = {};
CM.Sim = {}; CM.Sim = {};
}
if (typeof CM == "undefined") {
RunCookieMonsterHeader();
}