X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FSwap.js;h=071b21d4ca5b810b324f208de96fbbc15c4e8db3;hp=bf4e78715c000b9b0992733db0859edab0c89efb;hb=0e0ffdddc2d93cac3ccf5ca556b2f47cbfef0228;hpb=0ada7ac59ce418a2f03c559ad4d495407bdc47ce diff --git a/client/src/variants/Swap.js b/client/src/variants/Swap.js index bf4e7871..071b21d4 100644 --- a/client/src/variants/Swap.js +++ b/client/src/variants/Swap.js @@ -71,7 +71,7 @@ export class SwapRules extends ChessRules { const color = this.turn; const piece = this.getPiece(x, y); const addSmoves = (i, j) => { - if (this.getPiece(i, j) != piece) + if (this.getPiece(i, j) != piece || this.getColor(i, j) != color) Array.prototype.push.apply(moves, this.getSwapMoves([x, y], [i, j])); }; switch (piece) {