X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=207892f4dea1fce081a588dcbab770b8c3aab18e;hp=3dbd6dc03a8db98b1da7501432296f99187d00a4;hb=4b3a0fdab03a7529ede42891963d3036712a0bd5;hpb=4ede49cd850392f28bc9da9537c111d2c3f0b297 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 3dbd6dc0..207892f4 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -509,7 +509,9 @@ Value do_evaluate(const Position& pos, Value& margin) { ei.kingAdjacentZoneAttacksCount[Us] += popcount(bb); } - int mob = popcount(b & mobilityArea); + int mob = Piece != QUEEN ? popcount(b & mobilityArea) + : popcount(b & mobilityArea); + mobility += MobilityBonus[Piece][mob]; // Decrease score if we are attacked by an enemy pawn. Remaining part @@ -765,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) @@ -821,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