Compare commits

...

2 Commits

Author SHA1 Message Date
ThePendulum bdc2d0d3cb 1.16.3 2022-10-24 02:47:44 +02:00
ThePendulum 2c2e7ee532 Defaulting negative dice inputs. 2022-10-24 02:47:39 +02:00
3 changed files with 5 additions and 10 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "schat2-clive",
"version": "1.16.2",
"version": "1.16.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "schat2-clive",
"version": "1.16.2",
"version": "1.16.3",
"license": "ISC",
"dependencies": {
"bhttp": "^1.2.8",

View File

@ -1,6 +1,6 @@
{
"name": "schat2-clive",
"version": "1.16.2",
"version": "1.16.3",
"description": "Game host for SChat 2-powered chat sites",
"main": "src/app.js",
"scripts": {

View File

@ -15,13 +15,8 @@ function onCommand(args, context) {
return;
}
const rolls = Number(args[0]) || 1;
const faces = Number(args[1]) || 6;
if (rolls < 1 || faces < 1) {
context.sendMessage('The dice must exist in the physical universe.', context.room.id);
return;
}
const rolls = Math.max(Number(args[0]) || 1, 1);
const faces = Math.max(Number(args[1]) || 6, 1);
if (rolls > config.dice.maxRolls) {
context.sendMessage(`You can only roll ${config.dice.maxRolls} dice at one time`, context.room.id);