X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=8eb0364844a363e5fb33e5a7e55a4d8e26dd739c;hp=1d52d30cd9ccdb8f746d11eb10d89ebc26ed3dc4;hb=a66e6e5ad903218a612fdaaf027999b9d48a0294;hpb=7bce8831d361317e0cf5156a888ca2d3e568a2ff diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 1d52d30c..8eb03648 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -583,7 +583,7 @@ namespace { const Color Them = (Us == WHITE ? BLACK : WHITE); - Bitboard b, squaresToQueen, defendedSquares, unsafeSquares, supportingPawns; + Bitboard b, squaresToQueen, defendedSquares, unsafeSquares; Score score = SCORE_ZERO; b = ei.pi->passed_pawns(Us); @@ -633,33 +633,22 @@ namespace { else defendedSquares = squaresToQueen & ei.attackedBy[Us][ALL_PIECES]; - // If there aren't any enemy attacks, then assign a huge bonus. - // The bonus will be a bit smaller if at least the block square - // isn't attacked, otherwise assign the smallest possible bonus. - int k = !unsafeSquares ? 15 : !(unsafeSquares & blockSq) ? 9 : 3; + // If there aren't any enemy attacks, assign a big bonus. Otherwise + // assign a smaller bonus if the block square isn't attacked. + int k = !unsafeSquares ? 15 : !(unsafeSquares & blockSq) ? 9 : 0; - // Assign a big bonus if the path to the queen is fully defended, - // otherwise assign a bit less of a bonus if at least the block - // square is defended. + // If the path to queen is fully defended, assign a big bonus. + // Otherwise assign a smaller bonus if the block square is defended. if (defendedSquares == squaresToQueen) k += 6; else if (defendedSquares & blockSq) - k += (unsafeSquares & defendedSquares) == unsafeSquares ? 4 : 2; + k += 4; mbonus += Value(k * rr), ebonus += Value(k * rr); } } // rr != 0 - // Increase the bonus if the passed pawn is supported by a friendly pawn - // on the same rank and a bit smaller if it's on the previous rank. - supportingPawns = pos.pieces(Us, PAWN) & adjacent_files_bb(file_of(s)); - if (supportingPawns & rank_bb(s)) - ebonus += Value(r * 20); - - else if (supportingPawns & rank_bb(s - pawn_push(Us))) - ebonus += Value(r * 12); - // Rook pawns are a special case: They are sometimes worse, and // sometimes better than other passed pawns. It is difficult to find // good rules for determining whether they are good or bad. For now,