From 518bfb7a260f95e282f763878c2e9cf5ba58ef86 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Fri, 8 Jul 2022 00:57:46 +0200
Subject: [PATCH] Fix typo

---
 base_rules.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/base_rules.js b/base_rules.js
index 88197ea..2d08bd6 100644
--- a/base_rules.js
+++ b/base_rules.js
@@ -2340,14 +2340,13 @@ export default class ChessRules {
   }
 
   postPlay(move) {
-    const color = this.turn;
     if (this.options["dark"])
       this.updateEnlightened();
     if (this.options["teleport"]) {
       if (
         this.subTurnTeleport == 1 &&
         move.vanish.length > move.appear.length &&
-        move.vanish[1].c == color
+        move.vanish[1].c == this.turn
       ) {
         const v = move.vanish[move.vanish.length - 1];
         this.captured = {x: v.x, y: v.y, c: v.c, p: v.p};
@@ -2362,7 +2361,7 @@ export default class ChessRules {
 
   tryChangeTurn(move) {
     if (this.isLastMove(move)) {
-      this.turn = C.GetOppCol(color);
+      this.turn = C.GetOppCol(this.turn);
       this.movesCount++;
       this.subTurn = 1;
     }
-- 
2.44.0