Anahkiasen / cookie-monster

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

Fixes issue #31 - Two season upgrades not being removed from store #49

Closed Qhorin closed 10 years ago

Qhorin commented 10 years ago

This should resolve #31

Two Christmas upgrades were not being removed from the store after being clicked/purchased. They differ from other upgrades because they trigger a store Refresh (which is usually triggered by building purchases). The upgrades 'Season savings' and 'Santa's dominion' reduce building costs and trigger a store Refresh which triggers CookieMonster simulateBuy() before Cookie Clicker code has removed the upgrade from the store. The simulateBuy() resets the upgrade's bought variable back to 0 so it stays in the store when upgrades are rebuilt.

To fix, I added a check in the isInStore() function to see if upgrade bought variable === 1. This prevents the simulateBuy() from executing for this upgrade (and some other functions in the stack that seems to be unnecessary for purchased upgrades e.g. tooltips).

Qhorin commented 10 years ago

What criteria is used to change the version number? It currently is 1.041.01. Is that something contributors should change when submitting a pull request, or just the maintainer? I guess if contributors changed the value and submitted pull requests at the same time, the version numbers could be the same.

Anahkiasen commented 10 years ago

Yeah I'll bump the version number.

Anahkiasen commented 10 years ago

Thanks!