From dad45245582514fc89bf6cbb5bd7622026be2c51 Mon Sep 17 00:00:00 2001 From: govind-maheshwari2 <132160327+govind-maheshwari2@users.noreply.github.com> Date: Tue, 3 Dec 2024 04:28:34 -0800 Subject: [PATCH] fix queen side castling issue Unable to provide queen side castling for `r1bq1rk1/pp2npbp/2np2p1/2p5/4P2P/2NPB1P1/PPP1QPB1/R3K2R w KQq - 0 1` FEN. --- lib/src/game/game.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/game/game.dart b/lib/src/game/game.dart index b6d49b0..ff6ae70 100644 --- a/lib/src/game/game.dart +++ b/lib/src/game/game.dart @@ -468,7 +468,7 @@ class Game { continue; } // king starting on target - if (j != numMidSqs && board[midSq].isNotEmpty) { + if (j != numMidSqs && from != midSq && board[midSq].isNotEmpty) { // squares between to and from must be empty valid = false; break;