From 0e0ffdddc2d93cac3ccf5ca556b2f47cbfef0228 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Mon, 4 May 2020 00:36:49 +0200
Subject: [PATCH] Fix Swap variant

---
 client/src/variants/Swap.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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) {
-- 
2.44.0