X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fevaluate.cpp;h=2cb9979d295a863900c13bca115404251e0cafd9;hb=d570260a28c6229ca75078dc616011e994fe6378;hp=49dc07fe671ef0885ca9b5fbfd29a8fd2cc885ad;hpb=0901e12102cf61559e6bfbbda0a040c72048dc8c;p=stockfish diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 49dc07fe..2cb9979d 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -150,6 +150,9 @@ namespace { #undef S + // CLOP now likes 85, 31 - try next + const Score BishopPinBonus = make_score(34, 17); + // Bonus for having the side to move (modified by Joona Kiiski) const Score Tempo = make_score(24, 11); @@ -577,22 +580,15 @@ Value do_evaluate(const Position& pos, Value& margin) { mobility += MobilityBonus[Piece][mob]; - // Add a bonus if a slider is pinning an enemy piece - if ( (Piece == BISHOP || Piece == ROOK || Piece == QUEEN) - && (PseudoAttacks[Piece][pos.king_square(Them)] & s)) - { - b = BetweenBB[s][pos.king_square(Them)] & pos.pieces(); - - assert(b); - - if (!more_than_one(b) && (b & pos.pieces(Them))) - score += ThreatBonus[Piece][type_of(pos.piece_on(lsb(b)))]; - } - // Decrease score if we are attacked by an enemy pawn. Remaining part // of threat evaluation must be done later when we have full attack info. if (ei.attackedBy[Them][PAWN] & s) score -= ThreatenedByPawnPenalty[Piece]; + else if (Piece == BISHOP && (PseudoAttacks[Piece][pos.king_square(Them)] & s)) { + const Bitboard between = BetweenBB[s][pos.king_square(Them)] & pos.pieces(); + if (!more_than_one(between)) + score += BishopPinBonus; + } // Bishop and knight outposts squares if ( (Piece == BISHOP || Piece == KNIGHT) @@ -699,8 +695,7 @@ Value do_evaluate(const Position& pos, Value& margin) { & ~ei.attackedBy[Them][0]; if (undefendedMinors) - score += more_than_one(undefendedMinors) ? UndefendedMinorPenalty * 2 - : UndefendedMinorPenalty; + score += UndefendedMinorPenalty; // Enemy pieces not defended by a pawn and under our attack weakEnemies = pos.pieces(Them)