X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmaterial.cpp;h=5b77ddc2b30b7ceb03d4d3b5fa253db9493693aa;hp=d5d670ba27324dbe3d1164a29fae18535f3be6a1;hb=1574428f64d0368b943e6275c509e02af2047e7e;hpb=13a73f67c018e58b2fd46f886c45ef2b75188c8e diff --git a/src/material.cpp b/src/material.cpp index d5d670ba..5b77ddc2 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -1,7 +1,7 @@ /* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 Tord Romstad (Glaurung author) - Copyright (C) 2008-2013 Marco Costalba, Joona Kiiski, Tord Romstad + Copyright (C) 2008-2014 Marco Costalba, Joona Kiiski, Tord Romstad Stockfish is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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) {