CookieMonster: Cookie Monster conflicts with content mods

If a mods adds upgrades and achievements after Cookie Monster loads, then CM.Sim.Upgrades[i] and CM.Sim.Achievements[i] in CM.Sim.CopyData might be undefined, triggering a crash.

This is particularly problematic with mods that use Klattmose’s CCSE, like American Season and my own Spiced Cookies, because CCSE finishes injecting hooks hundreds of milliseconds after it finishes loading. This interval is long enough for Cookie Monster to load, so simply setting Cookie Monster to load last is not enough.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Good, then I’ll close it!

Not really a discord user myself, but perhaps I will take a look in the near future. If any other problems arise I am usually quick to respond to new issues!

I have only started looking into the code of CM as of today, so I must confess I am also not totally sure what the reasoning behind CM.Sim.CopyData is and why it is called repeatedly.

I have just rewritten a significant portion related to another issue so I will get back to you and this issue. At the moment your suggestion seems fine, so I will certainly consider it.