From: Gary Linscott Date: Mon, 11 Feb 2013 15:26:18 +0000 (-0500) Subject: Bishop pins only X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=a7cdf7299a771949332f8c7ef77ae8fd125d0f08;hp=-c Bishop pins only --- a7cdf7299a771949332f8c7ef77ae8fd125d0f08 diff --combined src/evaluate.cpp index e29b9b0f,49dc07fe..183f166a --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@@ -577,16 -577,22 +577,15 @@@ Value do_evaluate(const Position& pos, mobility += MobilityBonus[Piece][mob]; - 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 += make_score(25, 25); - // 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 += make_score(15, 25); ++ } // Bishop and knight outposts squares if ( (Piece == BISHOP || Piece == KNIGHT) @@@ -693,7 -699,8 +692,8 @@@ & ~ei.attackedBy[Them][0]; if (undefendedMinors) - score += UndefendedMinorPenalty; + score += more_than_one(undefendedMinors) ? UndefendedMinorPenalty * 2 + : UndefendedMinorPenalty; // Enemy pieces not defended by a pawn and under our attack weakEnemies = pos.pieces(Them)