From 1cc88f6bf9091684a3f92deb7c032f4b3888a221 Mon Sep 17 00:00:00 2001 From: TiynGER Date: Mon, 14 Dec 2020 22:50:28 +0100 Subject: [PATCH] game bugfix: after castling toMove wasnt changed If you castle correctly the toMove attribute of the game object wasnt changed. This is now fixed. --- chess.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/chess.nim b/chess.nim index 1f71796..ced3648 100644 --- a/chess.nim +++ b/chess.nim @@ -644,6 +644,7 @@ proc castling(game: var Game, kstart: int, dest_kingside: bool, return false game.uncheckedMove(kstart, kdest) game.uncheckedMove(rstart, rdest) + game.toMove = Color(ord(game.toMove)*(-1)) return true return false except IndexDefect, ValueError: