X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fpawns.cpp;h=7b266e779cc5fb7c76bcd91f28403ff5aeb43aa2;hb=353e20674b2019094059caaa3567e9a44abe9cd1;hp=7c4eda0f0b07dc256e48db24327f2be4c634d707;hpb=db59696aaf91641ade911c4a6ca393a1691d78a8;p=stockfish diff --git a/src/pawns.cpp b/src/pawns.cpp index 7c4eda0f..7b266e77 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -86,7 +86,6 @@ namespace { e->passedPawns[Us] = 0; e->kingSquares[Us] = SQ_NONE; e->pawnAttacks[Us] = e->pawnAttacksSpan[Us] = pawn_attacks_bb(ourPawns); - e->blockedCount[Us] = 0; // Loop through all pawns of the current color and score each pawn while ((s = *pl++) != SQ_NONE) @@ -106,7 +105,7 @@ namespace { phalanx = neighbours & rank_bb(s); support = neighbours & rank_bb(s - Up); - e->blockedCount[Us] += bool(blocked); + e->blockedCount += blocked || more_than_one(leverPush); // A pawn is backward when it is behind all pawns of the same color on // the adjacent files and cannot safely advance. @@ -138,7 +137,7 @@ namespace { // Score this pawn if (support | phalanx) { - int v = Connected[r] * (2 + bool(phalanx) - bool(opposed)) + int v = Connected[r] * (4 + 2 * bool(phalanx) - 2 * bool(opposed) - bool(blocked)) / 2 + 21 * popcount(support); score += make_score(v, v * (r - 2) / 4); @@ -178,6 +177,7 @@ Entry* probe(const Position& pos) { return e; e->key = key; + e->blockedCount = 0; e->scores[WHITE] = evaluate(pos, e); e->scores[BLACK] = evaluate(pos, e); @@ -244,7 +244,7 @@ Score Entry::do_king_safety(const Position& pos) { // In endgame we like to bring our king near our closest pawn Bitboard pawns = pos.pieces(Us, PAWN); - int minPawnDist = pawns ? 8 : 0; + int minPawnDist = 6; if (pawns & PseudoAttacks[KING][ksq]) minPawnDist = 1;