From cc0f1cbf5844499838d34d7c7342e64e5d33dbe3 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Tue, 20 Apr 2021 11:47:22 +0200
Subject: [PATCH] Fix Maxima (immobilize kings too)

---
 client/src/variants/Maxima.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/client/src/variants/Maxima.js b/client/src/variants/Maxima.js
index df781b9e..d8347ac5 100644
--- a/client/src/variants/Maxima.js
+++ b/client/src/variants/Maxima.js
@@ -145,8 +145,9 @@ export class MaximaRules extends ChessRules {
     // Pre-check: is thing on this square immobilized?
     const imSq = this.isImmobilized([x, y]);
     const piece = this.getPiece(x, y);
-    if (!!imSq && piece != V.KING) {
-      // Only option is suicide, if I'm not a king:
+    if (!!imSq) {
+      if (piece == V.KING) return [];
+      // Only option is suicide
       return [
         new Move({
           start: { x: x, y: y },
-- 
2.44.0