From: Benjamin Auder Date: Tue, 20 Apr 2021 09:47:22 +0000 (+0200) Subject: Fix Maxima (immobilize kings too) X-Git-Url: https://git.auder.net/game/current/app_dev.php/doc/html/%3C?a=commitdiff_plain;h=cc0f1cbf5844499838d34d7c7342e64e5d33dbe3;p=vchess.git Fix Maxima (immobilize kings too) --- 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 },