X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=207892f4dea1fce081a588dcbab770b8c3aab18e;hp=8bbd0bff161b3917f6fae299f6f21fe7ff65d2af;hb=4b3a0fdab03a7529ede42891963d3036712a0bd5;hpb=9749f1f14c956133c2f42f96592b46f4f2c2b7ec diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 8bbd0bff..207892f4 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -767,7 +767,7 @@ Value do_evaluate(const Position& pos, Value& margin) { // be very big, and so capturing a single attacking piece can therefore // result in a score change far bigger than the value of the captured piece. score -= KingDanger[Us == Search::RootColor][attackUnits]; - margins[Us] += mg_value(KingDanger[Us == Search::RootColor][attackUnits]); + margins[Us] += mg_value(KingDanger[Us == Search::RootColor][attackUnits]) / 2; } if (Trace) @@ -823,7 +823,7 @@ Value do_evaluate(const Position& pos, Value& margin) { // If there is an enemy rook or queen attacking the pawn from behind, // add all X-ray attacks by the rook or queen. Otherwise consider only // the squares in the pawn's path attacked or occupied by the enemy. - if ( (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN)) // Unlikely + if ( unlikely(forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN)) && (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN) & pos.attacks_from(s))) unsafeSquares = squaresToQueen; else