From a734a1a07f5309300a95ae2bd113c72be15bab22 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Thu, 6 Dec 2018 20:25:04 +0100
Subject: [PATCH] Fix antikings attacking rule

---
 public/javascripts/variants/Antiking.js | 4 ++--
 views/rules/Antiking.pug                | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/public/javascripts/variants/Antiking.js b/public/javascripts/variants/Antiking.js
index f9084951..71e01ff1 100644
--- a/public/javascripts/variants/Antiking.js
+++ b/public/javascripts/variants/Antiking.js
@@ -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");
 	}
diff --git a/views/rules/Antiking.pug b/views/rules/Antiking.pug
index eda7db44..28e264b7 100644
--- a/views/rules/Antiking.pug
+++ b/views/rules/Antiking.pug
@@ -36,6 +36,8 @@ p Note 1: athough antiking captures his color, it doesn't check his king.
 
 p Note 2: since it would allow a basic tactic (keep antiking touching opponent's king), kings do not attack antikings.
 
+p Note 3: an antiking does not check opponent's antiking.
+
 h3 Credits
 
 p
-- 
2.44.0