Protect against too small numbers

This commit is contained in:
Dragon Fire
2021-01-16 13:37:40 -05:00
parent 49b710aa14
commit 0c56aa9c13
+1 -1
View File
@@ -48,7 +48,7 @@ module.exports = class MinesweeperCommand extends Command {
if (!coordPicked) return false;
const x = Number.parseInt(coordPicked[1], 10);
const y = Number.parseInt(coordPicked[2], 10);
if (x > size || y > size) return false;
if (x > size || y > size || x < 1 || y < 1) return false;
if (game.mask[y - 1][x - 1]) return false;
return true;
};