Fix kingPos bug when taking en-passant in Atomic
authorBenjamin Auder <benjamin.auder@somewhere>
Sun, 9 Dec 2018 17:20:42 +0000 (18:20 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Sun, 9 Dec 2018 17:20:42 +0000 (18:20 +0100)
public/javascripts/variants/Atomic.js

index 997a70e..21fbedb 100644 (file)
@@ -60,9 +60,7 @@ class AtomicRules extends ChessRules
        {
                super.updateVariables(move);
                const color = this.getColor(move.start.x,move.start.y);
-               // Next condition to avoid conflicts with harmless castle moves
-               if (color != this.getColor(move.end.x,move.end.y)
-                       && this.board[move.end.x][move.end.y] != VariantRules.EMPTY)
+               if (move.appear.length == 0) //capture
                {
                        const firstRank = {"w": 7, "b": 0};
                        for (let c of ["w","b"])