Ishadijcks / Ishadijcks.github.io

PokéClicker
15 stars 32 forks source link

Fossils giving diamonds when used #35

Closed Aegyo closed 7 years ago

Aegyo commented 7 years ago

The way you are handling the default parameter for value and valueType will assign your default value for any falsey parameter passed to it, so it is overwriting 0 when adding the fossils.

http://stackoverflow.com/questions/894860/set-a-default-parameter-value-for-a-javascript-function

Ishadijcks commented 7 years ago

Ah, they have a value of 0 but because I OR with 1, it is still assigned 1?

Aegyo commented 7 years ago

Yes, that is what is happening for the fossils.

Ishadijcks commented 7 years ago

Nice one :)