X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=566eba6d93433659afa89898dac49de293c50cbb;hp=51cba651d5ef0088c912c79ca8ac622ce75a1eca;hb=298cf150958212e3270182644fd87f5489823b27;hpb=aa0166fba66d1bd3d2756f8f16b7f6161064d0a3 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 51cba651..566eba6d 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) @@ -472,10 +472,10 @@ namespace { - 6 * mg_value(score) / 8 + mg_value(mobility[Them] - mobility[Us]) + 5 * kingFlankAttacks * kingFlankAttacks / 16 - - 25; + - 15; // Transform the kingDanger units into a Score, and subtract it from the evaluation - if (kingDanger > 0) + if (kingDanger > 100) score -= make_score(kingDanger * kingDanger / 4096, kingDanger / 16); // Penalty when our king is on a pawnless flank @@ -720,7 +720,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);