From 24a6312db06bd3632ff702389c3712f77d01046d Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Tue, 25 Jul 2023 19:21:48 +0200
Subject: [PATCH] Fix Chaining variant

---
 variants/Chaining/class.js | 3 ++-
 variants/Convert/class.js  | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/variants/Chaining/class.js b/variants/Chaining/class.js
index 5cd4c1d..9d771da 100644
--- a/variants/Chaining/class.js
+++ b/variants/Chaining/class.js
@@ -75,6 +75,7 @@ export default class ChainingRules extends ChessRules {
       );
     }
     mv.chained = destPiece; //easier (no need to detect it)
+//    mv.drag = {c: this.turn, p: initPiece}; //TODO: doesn't work
     return mv;
   }
 
@@ -103,7 +104,7 @@ export default class ChainingRules extends ChessRules {
 
   postPlay(move) {
     super.postPlay(move);
-    if (!!move.converted) {
+    if (!!move.chained) {
       this.lastMoveEnd.push({
         x: move.end.x,
         y: move.end.y,
diff --git a/variants/Convert/class.js b/variants/Convert/class.js
index 37c2c3d..bc99c63 100644
--- a/variants/Convert/class.js
+++ b/variants/Convert/class.js
@@ -76,6 +76,7 @@ export default class ConvertRules extends ChessRules {
       );
     }
     mv.converted = destPiece; //easier (no need to detect it)
+//    mv.drag = {c: this.turn, p: initPiece}; //TODO: doesn't work
     return mv;
   }
 
-- 
2.44.0