mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 06:42:50 +02:00
Fix
This commit is contained in:
@@ -66,8 +66,8 @@ module.exports = class DomineeringCommand extends Command {
|
|||||||
if (pick.toLowerCase() === 'end') return true;
|
if (pick.toLowerCase() === 'end') return true;
|
||||||
const coordPicked = pick.match(turnRegex);
|
const coordPicked = pick.match(turnRegex);
|
||||||
if (!coordPicked) return false;
|
if (!coordPicked) return false;
|
||||||
const x = Number.parseInt(coordPicked[2], 10);
|
const x = Number.parseInt(coordPicked[1], 10);
|
||||||
const y = Number.parseInt(coordPicked[3], 10);
|
const y = Number.parseInt(coordPicked[2], 10);
|
||||||
if (x > size || y > size || x < 1 || y < 1) return false;
|
if (x > size || y > size || x < 1 || y < 1) return false;
|
||||||
if (!possibleMoves.includes(`${x - 1},${y - 1}`)) return false;
|
if (!possibleMoves.includes(`${x - 1},${y - 1}`)) return false;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user