mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Two small fixes in passed pawns evaluation
The one in evaluate_passed_pawns() is just a micro optimization, the other in evaluate_unstoppable_pawns() is indeed a fix, although almost unmeasurable in real games. Bugs report and fixes by Marek Kwiatkowski Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
5ee7dfebf7
commit
935fc09fd4
1 changed files with 2 additions and 2 deletions
|
@ -821,7 +821,7 @@ namespace {
|
|||
// add all X-ray attacks by the rook or queen. Otherwise consider only
|
||||
// the squares in the pawn's path attacked or occupied by the enemy.
|
||||
if ( (squares_behind(Us, s) & pos.pieces(ROOK, QUEEN, Them))
|
||||
&& (squares_behind(Us, s) & pos.pieces(ROOK, QUEEN, Them) & pos.attacks_from<QUEEN>(s)))
|
||||
&& (squares_behind(Us, s) & pos.pieces(ROOK, QUEEN, Them) & pos.attacks_from<ROOK>(s)))
|
||||
unsafeSquares = squaresToQueen;
|
||||
else
|
||||
unsafeSquares = squaresToQueen & (ei.attacked_by(Them) | pos.pieces_of_color(Them));
|
||||
|
@ -902,7 +902,7 @@ namespace {
|
|||
|
||||
if (d < 0 || pathDefended)
|
||||
{
|
||||
int mtg = RANK_8 - relative_rank(c, s);
|
||||
int mtg = RANK_8 - relative_rank(c, s) - int(relative_rank(c, s) == RANK_2);
|
||||
int blockerCount = count_1s_max_15(squares_in_front_of(c, s) & pos.occupied_squares());
|
||||
mtg += blockerCount;
|
||||
d += blockerCount;
|
||||
|
|
Loading…
Add table
Reference in a new issue