X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=19bfc9fe299820f3c4a95beeb2845f77892a2e47;hp=6cf7e4da58bf9a469512cf9179cfc4c2a74cffd7;hb=8765f9ce168b129b3283fc1e458eae2f8871b1d4;hpb=1e76ba7cec535e431a8d7486bfd41b3efbfad68e diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 6cf7e4da..19bfc9fe 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -197,7 +197,6 @@ namespace { const Score WeakQueen = S(50, 10); const Score Hanging = S(48, 27); const Score ThreatByPawnPush = S(38, 22); - const Score Unstoppable = S( 0, 20); const Score PawnlessFlank = S(20, 80); const Score HinderPassedPawn = S( 7, 0); const Score ThreatByRank = S(16, 3); @@ -678,6 +677,10 @@ namespace { mbonus += rr + r * 2, ebonus += rr + r * 2; } // rr != 0 + // Assign a small bonus when no pieces left (unstoppable) + if (!pos.non_pawn_material(Us) && !pos.non_pawn_material(Them)) + ebonus += 20; + score += make_score(mbonus, ebonus) + PassedFile[file_of(s)]; } @@ -852,17 +855,6 @@ Value Eval::evaluate(const Position& pos) { score += evaluate_passed_pawns(pos, ei) - evaluate_passed_pawns(pos, ei); - // If both sides have only pawns, score for potential unstoppable pawns - if (!pos.non_pawn_material(WHITE) && !pos.non_pawn_material(BLACK)) - { - Bitboard b; - if ((b = ei.pi->passed_pawns(WHITE)) != 0) - score += Unstoppable * int(relative_rank(WHITE, frontmost_sq(WHITE, b))); - - if ((b = ei.pi->passed_pawns(BLACK)) != 0) - score -= Unstoppable * int(relative_rank(BLACK, frontmost_sq(BLACK, b))); - } - // Evaluate space for both sides, only during opening if (pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK) >= 12222) score += evaluate_space(pos, ei)