X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=6ec42e24e9a0c602e50b2838857bc49449106060;hp=859a1c38138ae8c1284e6d92ddfce20770f7c7b0;hb=619d66b7ab1b8491363f9fd5ce98372e51e55cde;hpb=800ba28e833cff47ef046637cf9e825031bb9244 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 859a1c38..6ec42e24 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -379,10 +379,10 @@ namespace { } // Give a bonus for a rook on a open or semi-open file - if (ei.pi->semiopen(Us, file_of(s))) - score += ei.pi->semiopen(Them, file_of(s)) ? RookOpenFile : RookSemiopenFile; + if (ei.pi->semiopen_file(Us, file_of(s))) + score += ei.pi->semiopen_file(Them, file_of(s)) ? RookOpenFile : RookSemiopenFile; - if (mob > 3 || ei.pi->semiopen(Us, file_of(s))) + if (mob > 3 || ei.pi->semiopen_file(Us, file_of(s))) continue; Square ksq = pos.king_square(Us); @@ -391,8 +391,8 @@ namespace { // king has lost its castling capability. if ( ((file_of(ksq) < FILE_E) == (file_of(s) < file_of(ksq))) && (rank_of(ksq) == rank_of(s) || relative_rank(Us, ksq) == RANK_1) - && !ei.pi->semiopen_on_side(Us, file_of(ksq), file_of(ksq) < FILE_E)) - score -= (TrappedRook - make_score(mob * 8, 0)) * (pos.can_castle(Us) ? 1 : 2); + && !ei.pi->semiopen_side(Us, file_of(ksq), file_of(s) < file_of(ksq))) + score -= (TrappedRook - make_score(mob * 8, 0)) * (1 + !pos.can_castle(Us)); } // An important Chess960 pattern: A cornered bishop blocked by a friendly @@ -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); @@ -651,15 +651,6 @@ namespace { } } // 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,