From 5a6893acc7ea711e352c868194a09c530035cca1 Mon Sep 17 00:00:00 2001 From: dece Date: Mon, 22 Jun 2020 19:17:09 +0200 Subject: [PATCH] rules: fix issue with bishop's promoting --- src/rules.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rules.rs b/src/rules.rs index 641b5c1..5d2c23e 100644 --- a/src/rules.rs +++ b/src/rules.rs @@ -365,8 +365,10 @@ fn get_moves_from_bb( // Automatic queen promotion for pawns moving to the opposite rank. if piece == PAWN - && (color == WHITE && sq_rank(ray_square) == RANK_8) - || (color == BLACK && sq_rank(ray_square) == RANK_1) + && ( + (color == WHITE && sq_rank(ray_square) == RANK_8) + || (color == BLACK && sq_rank(ray_square) == RANK_1) + ) { m.promotion = Some(QUEEN); }