GameBoard: ignore obvuisly bad moves
This commit is contained in:
parent
0e6e896851
commit
b6b1358131
@ -14,7 +14,10 @@ export default function GameBoard({ username, getGame, onStoneClick, onStoneMove
|
|||||||
(cellId) => onStoneClick(game.uuid, cellId);
|
(cellId) => onStoneClick(game.uuid, cellId);
|
||||||
|
|
||||||
const optionalOnStoneMove = (typeof onStoneMove !== 'function' || isPushing) ? null :
|
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 (
|
return (
|
||||||
<div className='GameBoard'>
|
<div className='GameBoard'>
|
||||||
|
Loading…
Reference in New Issue
Block a user