X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fevaluate.cpp;h=f1eb71ec30e11affe1d17496f35ef47288a5a770;hb=c2c0e6b07de96c1fc39528b613fb3c9f93a8d7dc;hp=09f06d2983e0b644bf9dadd94fa6efc7baae1051;hpb=3549d98d07a6f0d04e4d020e009903dd82d0fadf;p=stockfish diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 09f06d29..f1eb71ec 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -348,6 +348,13 @@ namespace { score -= (TrappedRook - make_score(mob * 22, 0)) * (1 + !pos.can_castle(Us)); } } + + if (Pt == QUEEN) + { + // Penalty if any relative pin or discovered attack against the queen + if (pos.slider_blockers(pos.pieces(), pos.pieces(Them, ROOK, BISHOP), s)) + score -= WeakQueen; + } } if (DoTrace) @@ -489,13 +496,6 @@ namespace { & ~(ei.attackedBy[Us][ALL_PIECES] | ei.attackedBy[Them][ALL_PIECES])) score += LooseEnemies; - // Bonus for pin or discovered attack on the opponent queen - if ( pos.count(Them) == 1 - && pos.slider_blockers(pos.pieces(), - pos.pieces(Us, ROOK, BISHOP), - pos.square(Them))) - score += WeakQueen; - // Non-pawn enemies attacked by a pawn weak = (pos.pieces(Them) ^ pos.pieces(Them, PAWN)) & ei.attackedBy[Us][PAWN]; @@ -722,7 +722,7 @@ namespace { // Endgame with opposite-colored bishops, but also other pieces. Still // a bit drawish, but not as drawish as with only the two bishops. else - sf = ScaleFactor(46 * sf / SCALE_FACTOR_NORMAL); + sf = ScaleFactor(46); } // Endings where weaker side can place his king in front of the opponent's // pawns are drawish.