X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FSuicide.js;h=e3630bb408ae7a9df11a3c82beb74bf8c407c760;hb=1d67d9611c52fbe667cea39f68098f4e52464223;hp=ecb2aef146e525c0ffc8a8173919bc952518a2df;hpb=e50a802531b99829c533f22ecd21e359e7e1e049;p=vchess.git diff --git a/client/src/variants/Suicide.js b/client/src/variants/Suicide.js index ecb2aef1..e3630bb4 100644 --- a/client/src/variants/Suicide.js +++ b/client/src/variants/Suicide.js @@ -50,12 +50,11 @@ export class SuicideRules extends ChessRules { // Stop at the first capture found (if any) atLeastOneCapture() { const color = this.turn; - const oppCol = V.GetOppCol(color); for (let i = 0; i < V.size.x; i++) { for (let j = 0; j < V.size.y; j++) { if ( this.board[i][j] != V.EMPTY && - this.getColor(i, j) != oppCol && + this.getColor(i, j) == color && this.getPotentialMovesFrom([i, j]).some(m => m.vanish.length == 2) ) { return true;