From 79c2ddb687267816299d5c6f7a7551cf59bdf6b1 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 26 Jan 2023 15:44:24 +0300 Subject: fix: do not allow castling under check --- src/board/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/board/mod.rs b/src/board/mod.rs index e21aaf1..d8166c3 100644 --- a/src/board/mod.rs +++ b/src/board/mod.rs @@ -299,6 +299,7 @@ impl Board { match rook_square.file() { 0 => { let castle_line = [ + king_home_position, king_home_position.west_one(), king_home_position.west_one().west_one(), ]; @@ -316,6 +317,7 @@ impl Board { }, 7 => { let castle_line = [ + king_home_position, king_home_position.east_one(), king_home_position.east_one().east_one(), ]; -- cgit v1.2.3