Fix /statcalc with invalid levels

This commit is contained in:
Leonard Craft III 2024-07-08 19:20:26 -05:00
parent dff9583500
commit 8ed5f1f2ca

View File

@ -1316,8 +1316,11 @@ export const commands: Chat.ChatCommands = {
} else if (lowercase.startsWith('lv') || lowercase.startsWith('level')) {
level = parseInt(arg.replace(/\D/g, ''));
lvlSet = true;
if (isNaN(level)) {
return this.sendReplyBox('Invalid value for level: ' + Utils.escapeHTML(arg));
}
if (level < 1 || level > 9999) {
return this.sendReplyBox('Invalid value for level: ' + level);
return this.sendReplyBox('Level should be between 1 and 9999.');
}
continue;
}