From 580c3d090e883cef5815e1bd4eefc94758c7df16 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Wed, 17 Feb 2021 19:34:14 +0100
Subject: [PATCH] Fix Chakart notation

---
 client/src/variants/Chakart.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/src/variants/Chakart.js b/client/src/variants/Chakart.js
index f170f707..5f20132e 100644
--- a/client/src/variants/Chakart.js
+++ b/client/src/variants/Chakart.js
@@ -1422,7 +1422,7 @@ export class ChakartRules extends ChessRules {
     let notation = undefined;
     if (piece == V.PAWN) {
       // Pawn move
-      if (move.vanish.length >= 2) {
+      if (this.board[move.end.x][move.end.y] != V.EMPTY) {
         // Capture
         const startColumn = V.CoordToColumn(move.start.y);
         notation = startColumn + "x" + finalSquare;
@@ -1435,7 +1435,7 @@ export class ChakartRules extends ChessRules {
     else {
       notation =
         piece.toUpperCase() +
-        (move.vanish.length >= 2 ? "x" : "") +
+        (this.board[move.end.x][move.end.y] != V.EMPTY ? "x" : "") +
         finalSquare;
     }
     if (!!move.end.effect) {
-- 
2.44.0