From fcffb2daa8c1b7ccfabbe6b4fe8460c67774c79c Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Wed, 8 Apr 2020 19:29:06 +0200
Subject: [PATCH] Fix Sittuyin promotions notation

---
 client/src/variants/Sittuyin.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/client/src/variants/Sittuyin.js b/client/src/variants/Sittuyin.js
index 004d626b..322439df 100644
--- a/client/src/variants/Sittuyin.js
+++ b/client/src/variants/Sittuyin.js
@@ -311,7 +311,15 @@ export class SittuyinRules extends ChessRules {
   getNotation(move) {
     // Do not note placement moves (complete move would be too long)
     if (move.vanish.length == 0) return "";
+    if (move.appear[0].p != move.vanish[0].p) {
+      // Pawn promotion: indicate correct final square
+      const initSquare =
+        V.CoordsToSquare({ x: move.vanish[0].x, y: move.vanish[0].y })
+      const destSquare =
+        V.CoordsToSquare({ x: move.vanish[0].x, y: move.vanish[0].y })
+      const prefix = (initSquare != destSquare ? initSquare : "");
+      return prefix + destSquare + "=Q";
+    }
     return super.getNotation(move);
   }
 };
-
-- 
2.44.0