rules: fix issue with bishop's promoting

This commit is contained in:
dece 2020-06-22 19:17:09 +02:00
parent 9595d0f435
commit 5a6893acc7

View file

@ -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);
}