Anahkiasen / cookie-monster

A rehosted, cleaned up and updated version of the CookieMonster plugin.
31 stars 24 forks source link

Resolves #52 - Unpurchased Chocolate Egg causes HUGE Cookie gain #53

Closed Qhorin closed 10 years ago

Qhorin commented 10 years ago

Resolves #52

  1. Stops simulateBuy of Chocolate egg upgrade.
  2. Bumps version number to 1.046.02.
  3. Rebuilt

The Chocolate egg was causing the cookie bank value to increase rapidly. Every time simulateBuy was executed on the Chocolate egg, it would add cookies to the bank, but the cookies were not removed from the bank afterwards. Since the upgrade does not add Cps, I see no need to simulate a buy. If the upgrade is later changed to add Cps, then this code will need to be rewritten.

To fix, I added an if statement in the simulateBuy function to check for the upgrade name and return 0. Don't know if that's the best way. If future Cookie Clicker upgrades also grant cookies, then they will need to be added to the if statement.

Enhancement: It may be desirable to add the amount of cookies received from the purchase of the Chocolate Egg to the tooltip, but that is outside the scope of this fix.

Anahkiasen commented 10 years ago

Thanks! Will deploy today