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,22 +1,27 @@
/**********
* Header *
**********/
RunCookieMonsterHeader = function() {
CM = {};
CM = {};
CM.Backup = {};
CM.Backup = {};
CM.Cache = {};
CM.Cache = {};
CM.Config = {};
CM.Config = {};
CM.ConfigData = {};
CM.ConfigData = {};
CM.Data = {};
CM.Data = {};
CM.Disp = {};
CM.Disp = {};
CM.Sim = {};
}
CM.Sim = {};
if (typeof CM == "undefined") {
RunCookieMonsterHeader();
}
/*********
* Cache *
@@ -4598,4 +4603,8 @@ CM.Sim.SellBuildingsForChoEgg = function() {
* Footer *
**********/
CM.Init();
if (!CM.isRunning) {
CM.Init();
CM.isRunning = 1
}

View File

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

View File

@@ -1,20 +1,25 @@
/**********
* Header *
**********/
RunCookieMonsterHeader = function() {
CM = {};
CM = {};
CM.Backup = {};
CM.Backup = {};
CM.Cache = {};
CM.Cache = {};
CM.Config = {};
CM.Config = {};
CM.ConfigData = {};
CM.ConfigData = {};
CM.Data = {};
CM.Data = {};
CM.Disp = {};
CM.Disp = {};
CM.Sim = {};
}
CM.Sim = {};
if (typeof CM == "undefined") {
RunCookieMonsterHeader();
}