X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fbase_rules.js;h=a0e64bd6067f0d90702aa41cdaf0949441b74223;hp=734af025a31e4fb9e09171fc7df4263200a631b7;hb=665eed903c4f294de82e7cb0ce4026b64fe64765;hpb=8bbf9c0242c5430a7531b0eb88e30bf61018446a diff --git a/client/src/base_rules.js b/client/src/base_rules.js index 734af025..a0e64bd6 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -990,7 +990,7 @@ export const ChessRules = class ChessRules { const color = this.turn; for (let i = 0; i < V.size.x; i++) { for (let j = 0; j < V.size.y; j++) { - if (this.getColor(i, j) == color) { + if (this.board[i][j] != V.EMPTY && this.getColor(i, j) == color) { const moves = this.getPotentialMovesFrom([i, j]); if (moves.length > 0) { for (let k = 0; k < moves.length; k++) {