From 332f31694d6df08c9d81089e03b182ebf4c04fb1 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Wed, 24 Mar 2021 15:06:11 +0100
Subject: [PATCH] Fix Chakart: King Boo bonus shouldn't add pieces in reserve

---
 client/src/variants/Chakart.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/client/src/variants/Chakart.js b/client/src/variants/Chakart.js
index 14e64b5c..ad584e3d 100644
--- a/client/src/variants/Chakart.js
+++ b/client/src/variants/Chakart.js
@@ -1018,7 +1018,11 @@ export class ChakartRules extends ChessRules {
     if (move.end.effect == "toadette") this.reserve = this.captured;
     else this.reserve = undefined;
     const color = move.turn[0];
-    if (move.vanish.length == 2 && move.vanish[1].c != 'a') {
+    if (
+      move.vanish.length == 2 &&
+      move.vanish[1].c != 'a' &&
+      move.appear.length == 1 //avoid king Boo!
+    ) {
       // Capture: update this.captured
       let capturedPiece = move.vanish[1].p;
       if (capturedPiece == V.INVISIBLE_QUEEN) capturedPiece = V.QUEEN;
-- 
2.48.1