Pretty date printing in PGN
[vchess.git] / public / javascripts / variants / Antiking.js
index 84f774a..71e01ff 100644 (file)
@@ -42,7 +42,7 @@ class AntikingRules extends ChessRules
                const piece2 = this.getPiece(x2,y2);
                const color1 = this.getColor(x1,y1);
                const color2 = this.getColor(x2,y2);
-               return !["a","A"].includes(piece2) &&
+               return piece2 != "a" &&
                        ((piece1 != "a" && color1 != color2) || (piece1 == "a" && color1 == color2));
        }
 
@@ -81,8 +81,8 @@ class AntikingRules extends ChessRules
        isAttackedByAntiking([x,y], colors)
        {
                const V = VariantRules;
-               if (this.getPiece(x,y) == V.KING)
-                       return false; //king is not attacked by antiking
+               if ([V.KING,V.ANTIKING].includes(this.getPiece(x,y)))
+                       return false; //(anti)king is not attacked by antiking
                return this.isAttackedBySlideNJump([x,y], colors, V.ANTIKING,
                        V.steps[V.ROOK].concat(V.steps[V.BISHOP]), "oneStep");
        }