asteriskman7/shepard_scale

Infinity saves as null. Probably breaks reload

Closed this issue · 1 comments

If an octave is upgraded a lot and left for a while without coda, it's possible to get to Infinity notes (presumably). If this gets saved, it will save as null instead of Infinity because JSON has no Infinity. When reloading, the null will probably break a lot of things.

Verify that this is possible.
Apply a fix.

Fixed by checking octave state on load to see if count was null or NaN and converting to Infinity if it is.
Also avoided NaN when buying an upgrade that costs Infinity while count is Infinity by just not decrementing count if cost is Infinity and count is Infinity.