Slimmmo / Slimmmo.github.io

AdVenture Capitalist calculator
http://slimmmo.github.io/
35 stars 42 forks source link

infinite loop in calculator #16

Open cwitty opened 8 years ago

cwitty commented 8 years ago

I was trying to figure out whether there was any point in putting money into anything besides oxygen bars on the moon, so I loaded the calculator, switched to the moon, put 2800 into each of the ten "number" slots, and didn't make any other changes (in particular, I left the number of angels as 0). Then, when I pushed the "Calculate" button, the browser froze for a few seconds and then put up a warning message about a script taking too long.

When I clicked on "Debug script", the backtrace shows that the script is looping in the "while (!isFinite(overflowPotential)) {" loop on line 512 of main.js, with unlockCost being Infinity.

Slimmmo commented 8 years ago

Thanks for pointing this out. This has made me realise that the calculator will not act nicely when it's in range (100 levels) of hitting the Infinite cost wall.