Avoid crash on double-loading

This commit is contained in:
Daniel van Noord
2020-12-02 13:24:56 +01:00
parent a8e3691507
commit 94745fb013
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();
}