Add Colorbound Clobberers (R. Betza)
[vchess.git] / client / src / variants / Cannibal.js
index 3a87a72..1a8a451 100644 (file)
@@ -88,7 +88,7 @@ export class CannibalRules extends ChessRules {
     return moves.filter(m => m.vanish.length == 2 && m.appear.length == 1);
   }
 
-       // Stop at the first capture found (if any)
+  // Stop at the first capture found (if any)
   atLeastOneCapture() {
     const color = this.turn;
     const oppCol = V.GetOppCol(color);
@@ -207,8 +207,9 @@ export class CannibalRules extends ChessRules {
       this.kingPos[c][0] = move.appear[0].x;
       this.kingPos[c][1] = move.appear[0].y;
       this.castleFlags[c] = [V.size.y, V.size.y];
-      return;
     }
+    // Next call is still required because the king may eat an opponent's rook
+    // TODO: castleFlags will be turned off twice then.
     super.updateCastleFlags(move, piece);
   }