From b6b13581318a3b9c454daeeae6839c067eda1984 Mon Sep 17 00:00:00 2001 From: djmil Date: Mon, 27 Nov 2023 15:03:57 +0100 Subject: [PATCH] GameBoard: ignore obvuisly bad moves --- webapp/src/container/games/GameBoard.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webapp/src/container/games/GameBoard.jsx b/webapp/src/container/games/GameBoard.jsx index f6b4bfe..437048e 100644 --- a/webapp/src/container/games/GameBoard.jsx +++ b/webapp/src/container/games/GameBoard.jsx @@ -14,7 +14,10 @@ export default function GameBoard({ username, getGame, onStoneClick, onStoneMove (cellId) => onStoneClick(game.uuid, cellId); const optionalOnStoneMove = (typeof onStoneMove !== 'function' || isPushing) ? null : - (move) => onStoneMove(game.uuid, move); + (move) => { + if (move[0] !== move[1] && game.board[move[1]] === undefined) + onStoneMove(game.uuid, move) + }; return (