toadchild / 40kdice

Statistical analysis tool for Warhammer 40,000 and Age of Sigmar
http://40k.ghostlords.com/dice/
MIT License
13 stars 7 forks source link

Bug: "Wound rolls of 6" select box AP options cause form submission to fail #1

Closed Frostbeard closed 5 years ago

Frostbeard commented 5 years ago

I stumbled upon this while simulating genestealers vs tactical marines.

To reproduce, enter the values as shown in this screenshot: image

Then, change the "Wound rolls of 6" to one of the armor piercing options (seems to happen for all of three of them) and hit "Roll". You'll get a console error that reads:

ReferenceError: wound_prob is not defined dice-1551158823.js:453:32 do_saves http://40k.ghostlords.com/dice/dice-1551158823.js:453 roll_40k http://40k.ghostlords.com/dice/dice-1551158823.js:648 onclick http://40k.ghostlords.com/dice/:1

Looks like wound_prob is out of scope for the do_saves function.

toadchild commented 5 years ago

Thanks for the bug report! Looks like I missed something the last time I refactored things.