X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmaterial.cpp;h=5b77ddc2b30b7ceb03d4d3b5fa253db9493693aa;hp=62ff1a747990b6ee043864224a20f26f78636226;hb=1574428f64d0368b943e6275c509e02af2047e7e;hpb=c9dcda6ac488c0058ebd567e1f52e30b8cd0db20 diff --git a/src/material.cpp b/src/material.cpp index 62ff1a74..5b77ddc2 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -61,7 +61,7 @@ namespace { }; // Endgame evaluation and scaling functions are accessed directly and not through - // the function maps because they correspond to more then one material hash key. + // the function maps because they correspond to more than one material hash key. Endgame EvaluateKmmKm[] = { Endgame(WHITE), Endgame(BLACK) }; Endgame EvaluateKXK[] = { Endgame(WHITE), Endgame(BLACK) }; @@ -246,6 +246,16 @@ Entry* probe(const Position& pos, Table& entries, Endgames& endgames) { (npm_w == npm_b || npm_b < RookValueMg ? 0 : NoPawnsSF[std::min(pos.count(BLACK), 2)]); } + if (pos.count(WHITE) == 1 && npm_w - npm_b <= BishopValueMg) + { + e->factor[WHITE] = (uint8_t) SCALE_FACTOR_ONEPAWN; + } + + if (pos.count(BLACK) == 1 && npm_b - npm_w <= BishopValueMg) + { + e->factor[BLACK] = (uint8_t) SCALE_FACTOR_ONEPAWN; + } + // Compute the space weight if (npm_w + npm_b >= 2 * QueenValueMg + 4 * RookValueMg + 2 * KnightValueMg) {