X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=8b017a5c880e8d1321cc2279ad6a97c097402ccb;hp=b20c93b706296c94b1a0c8652c4e4c87cb6a95e3;hb=0a8a3b8d9c1936c75a71d899d4bbfd6839621318;hpb=a0360cc2d4397edaad590cdf131fef95915b55c0 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index b20c93b7..8b017a5c 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -605,7 +605,7 @@ namespace { return std::min(distance(pos.square(c), s), 5); }; - Bitboard b, bb, squaresToQueen, defendedSquares, unsafeSquares; + Bitboard b, bb, squaresToQueen, unsafeSquares; Score score = SCORE_ZERO; b = pe->passed_pawns(Us); @@ -636,14 +636,11 @@ namespace { // If the pawn is free to advance, then increase the bonus if (pos.empty(blockSq)) { - defendedSquares = squaresToQueen = forward_file_bb(Us, s); + squaresToQueen = forward_file_bb(Us, s); unsafeSquares = passed_pawn_span(Us, s); bb = forward_file_bb(Them, s) & pos.pieces(ROOK, QUEEN); - if (!(pos.pieces(Us) & bb)) - defendedSquares &= attackedBy[Us][ALL_PIECES]; - if (!(pos.pieces(Them) & bb)) unsafeSquares &= attackedBy[Them][ALL_PIECES] | pos.pieces(Them); @@ -656,7 +653,7 @@ namespace { 0 ; // Assign a larger bonus if the block square is defended - if (defendedSquares & blockSq) + if ((pos.pieces(Us) & bb) || (attackedBy[Us][ALL_PIECES] & blockSq)) k += 5; bonus += make_score(k * w, k * w);