X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.cpp;h=7b266e779cc5fb7c76bcd91f28403ff5aeb43aa2;hp=63bc596fcba4cbb9b280c243af89fccc7fc7bff3;hb=8a1de2655ce9790d5f0360e2baefb0f5c0fe2944;hpb=d7a2d5a44588676abf9b49e35a5a567fd57ec3b0 diff --git a/src/pawns.cpp b/src/pawns.cpp index 63bc596f..7b266e77 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -105,6 +105,8 @@ namespace { phalanx = neighbours & rank_bb(s); support = neighbours & rank_bb(s - Up); + 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. backward = !(neighbours & forward_ranks_bb(Them, s + Up)) @@ -135,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); @@ -175,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); @@ -241,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;