3
0
mirror of https://github.com/reality/dbot.git synced 2025-01-12 04:52:36 +01:00

fix dice crash

This commit is contained in:
Dominic Brady 2012-11-24 13:18:18 +00:00
parent 96b2dd0ddd
commit 7faa5c1207

View File

@ -17,6 +17,14 @@ var parseDiceSpec = function (specString) {
var normalizeDiceSpec = function (specString) { var normalizeDiceSpec = function (specString) {
var diceSpec = parseDiceSpec(specString); var diceSpec = parseDiceSpec(specString);
if (diceSpec["sides"] > 10000) {
return false;
}
if (diceSpec["count"] > 1000) {
return false;
}
if (diceSpec["count"] > 1) { if (diceSpec["count"] > 1) {
var count = diceSpec["count"]; var count = diceSpec["count"];
} else { } else {