Fix Maxima (immobilize kings too)
[vchess.git] / client / src / variants / Maxima.js
index df781b9..d8347ac 100644 (file)
@@ -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 },