Anahkiasen/cookie-monster — pull request #53 by Qhorin (2014-05-21 14:03:07+00:00)
Title: Resolves #52 - Unpurchased Chocolate Egg causes HUGE Cookie gain

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.