visua0 / Melvor-Idle-Combat-Simulator-Reloaded

A browser extension for the game Melvor Idle
GNU General Public License v3.0
54 stars 23 forks source link

Crash on sim with no potion selected #87

Open huntexD opened 2 years ago

huntexD commented 2 years ago

If you start a sim with no potion selected the sim will error and never finish.

Uncaught TypeError: Herblore.potions[this.player.potionID] is undefined
    computeFactor           sources/injectable/Consumables.js:344
    updateSingleResult      sources/injectable/Consumables.js:313
    update                  sources/injectable/Consumables.js:300
    performPostSimAnalysis  sources/injectable/Simulator.js:867
    startJob                sources/injectable/Simulator.js:943
    processWorkerMessage    sources/injectable/Simulator.js:994
    onmessage               sources/injectable/Simulator.js:541
Consumables.js:344:38
    computeFactor           sources/injectable/Consumables.js:344
    updateSingleResult      sources/injectable/Consumables.js:313
    update                  sources/injectable/Consumables.js:300
    performPostSimAnalysis  sources/injectable/Simulator.js:867
    startJob                sources/injectable/Simulator.js:943
    processWorkerMessage    sources/injectable/Simulator.js:994
    onmessage               sources/injectable/Simulator.js:541
gmiclotte commented 2 years ago

Can't reproduce this, got a settings export?

Thanks!

huntexD commented 2 years ago

After having restarted my PC i can no longer reproduce this error either. Feel free to close this issue.

yuriks commented 2 years ago

I also experience this bug occasionally, though I haven't figured out a way to reproduce it reliably yet. EDIT: Forgot to mention, but the bug is temporarily resolved if you refresh the page to reload the game & simulator, until it starts happening again.

catharsis71 commented 2 years ago

This has been happening for me sporadically for a while

It seems to happen when I load a gearset with a potion already enabled, and then I manually disable the potion in the simulator

image

Here I'm simulating the Fire God Dungeon only. I initially had Diamond Luck 4 enabled in-game and after doing some simulation as-is, I disabled it in the simulator to see what the difference would be, that's when the problem manifested

When the problem happens it hangs on "Cancel (5/6)". if I hit the cancel button it resets to 0, quickly counts to 5, then freezes again. After trying to cancel a few times the button just disables so I can't even try to cancel anymore.

After the problem manifests the simulator becomes unusable until the game is completely reloaded.

note that I usually crank up the trials and ticks so that might or might not be related

image

catharsis71 commented 2 years ago

image

gmiclotte commented 2 years ago

Thanks for the detailed report, but I still can not reproduce this.

Apparently the sim thinks it consumed potions, while it clearly has not, since there is no active potion. I have no idea for the underlying cause, since I can not reproduce it.

However, I've now made a change that will prevent the crash and log a warning when it tries to process an "undefined potion", so it should at least no longer crash (with the next release).

Thanks for the reports!