angarg12 / nucleogenesis

Nucleogenesis JS incremental game
GNU General Public License v3.0
40 stars 20 forks source link

Fusion settings can cause game to freeze unrecoverably #191

Closed jjclark1982 closed 5 years ago

jjclark1982 commented 5 years ago

I selected Sn-126 and Po-210 for Fusion.

After reloading the game in this state, the Fusion tab shows the "Beam and Target" column, but not the "Product" column. After viewing this tab, the game time stops advancing, and this error message appears in the console:

TypeError: Cannot read property '336' of undefined
    at Object.ct.getProductIsotope (app.min.js:6332)
    at fn (eval at compile (angular.js:16387), <anonymous>:4:941)
    at m.$digest (angular.js:19095)
    at m.$apply (angular.js:19463)
    at angular.js:14236

The element dropdowns are disabled, so I cannot get it out of this state by selecting different elements. I have tried all types of prestige and reloading, but this game is thoroughly stuck. Here is the save data: https://pastebin.com/crR8F8dq

angarg12 commented 5 years ago

Thanks for the report, I have a good idea of what might be going on.

I'll take a look and update you with my findings.

angarg12 commented 5 years ago

I pushed a fix, it should be live shortly.

Please check whether it works.

angarg12 commented 5 years ago

BTW I double checked your save and although the bug is fixed, the save is stuck on fusion. Fixing it requires manual intervention since there is no way to stop a fusion.

I could send a fixed save your way. I was wondering though if it would be good to introduce a systemic way to fix these cases in the game. I need to think a bit about it.

jjclark1982 commented 5 years ago

Thanks for fixing the freezing error. I set active and running to false in the fusion save data and the dropdowns became usable again.

I think it would be safe to automatically disable active and running when visiting the fusion tab for the first time and there is no valid product.