mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 09:13:08 +00:00
Fix a couple of issues in bitbase.cpp
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
09d217bff7
commit
d653aeca05
1 changed files with 6 additions and 0 deletions
|
@ -162,6 +162,11 @@ namespace {
|
||||||
&& pawnSquare == SQ_A7
|
&& pawnSquare == SQ_A7
|
||||||
&& (blackKingSquare == SQ_C7 || blackKingSquare == SQ_C8))
|
&& (blackKingSquare == SQ_C7 || blackKingSquare == SQ_C8))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if ( whiteKingSquare == SQ_H8
|
||||||
|
&& pawnSquare == SQ_H7
|
||||||
|
&& (blackKingSquare == SQ_F7 || blackKingSquare == SQ_F8))
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -172,6 +177,7 @@ namespace {
|
||||||
// white pawn can be promoted without getting captured.
|
// white pawn can be promoted without getting captured.
|
||||||
return sideToMove == WHITE
|
return sideToMove == WHITE
|
||||||
&& square_rank(pawnSquare) == RANK_7
|
&& square_rank(pawnSquare) == RANK_7
|
||||||
|
&& whiteKingSquare != pawnSquare + DELTA_N
|
||||||
&& ( square_distance(blackKingSquare, pawnSquare + DELTA_N) > 1
|
&& ( square_distance(blackKingSquare, pawnSquare + DELTA_N) > 1
|
||||||
|| bit_is_set(wk_attacks(), pawnSquare + DELTA_N));
|
|| bit_is_set(wk_attacks(), pawnSquare + DELTA_N));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue