X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fevaluate.cpp;h=7e6260c8a34128fe588b3a2c492e07af526986b1;hb=7ede1ed0716744270544dcb1ee71ca907c6d9c23;hp=7408a77ccf0236c02dab1608399d7311901594c5;hpb=ab4b94e1737fcdf9f5174a96e80bbdc985c95267;p=stockfish diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 7408a77c..7e6260c8 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -328,7 +328,7 @@ namespace { // bishop, bigger when the center files are blocked with pawns. Bitboard blocked = pos.pieces(Us, PAWN) & shift(pos.pieces()); - score -= BishopPawns * pe->pawns_on_same_color_squares(Us, s) + score -= BishopPawns * pos.pawns_on_same_color_squares(Us, s) * (1 + popcount(blocked & CenterFiles)); // Bonus for bishop on a long diagonal which can "see" both center squares @@ -358,8 +358,8 @@ namespace { score += RookOnPawn * popcount(pos.pieces(Them, PAWN) & PseudoAttacks[ROOK][s]); // Bonus for rook on an open or semi-open file - if (pe->semiopen_file(Us, file_of(s))) - score += RookOnFile[bool(pe->semiopen_file(Them, file_of(s)))]; + if (pos.semiopen_file(Us, file_of(s))) + score += RookOnFile[bool(pos.semiopen_file(Them, file_of(s)))]; // Penalty when trapped by the king, even more if the king cannot castle else if (mob <= 3) @@ -467,12 +467,13 @@ namespace { + 69 * kingAttacksCount[Them] + 185 * popcount(kingRing[Us] & weak) - 100 * bool(attackedBy[Us][KNIGHT] & attackedBy[Us][KING]) + - 35 * bool(attackedBy[Us][BISHOP] & attackedBy[Us][KING]) + 150 * popcount(pos.blockers_for_king(Us) | unsafeChecks) - 873 * !pos.count(Them) - 6 * mg_value(score) / 8 + mg_value(mobility[Them] - mobility[Us]) + 5 * kingFlankAttacks * kingFlankAttacks / 16 - - 15; + - 7; // Transform the kingDanger units into a Score, and subtract it from the evaluation if (kingDanger > 100) @@ -720,7 +721,7 @@ namespace { int bonus = popcount(safe) + popcount(behind & safe); int weight = pos.count(Us) - - 2 * popcount(pe->semiopenFiles[WHITE] & pe->semiopenFiles[BLACK]); + - (16 - pos.count()) / 4; Score score = make_score(bonus * weight * weight / 16, 0);