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.
Resolves #52
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.