X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmaterial.cpp;h=b106892bcfa83fdbae9ec553c03871a194224c32;hp=0e3ca8320e7a586a5a0f99cbf0a85e2b103d52d8;hb=dc88cd691f5b393fe52c1b2be93d467def7391ea;hpb=32c504076f5a1d5c84f88c2d30a11c25ea2e5a6e diff --git a/src/material.cpp b/src/material.cpp index 0e3ca832..b106892b 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -108,7 +108,7 @@ MaterialEntry* MaterialTable::probe(const Position& pos) { // Let's look if we have a specialized evaluation function for this // particular material configuration. First we look for a fixed // configuration one, then a generic one if previous search failed. - if ((e->evaluationFunction = endgames.probe(key)) != NULL) + if (endgames.probe(key, e->evaluationFunction)) return e; if (is_KXK(pos)) @@ -127,8 +127,8 @@ MaterialEntry* MaterialTable::probe(const Position& pos) { { // Minor piece endgame with at least one minor piece per side and // no pawns. Note that the case KmmK is already handled by KXK. - assert((pos.pieces(KNIGHT, WHITE) | pos.pieces(BISHOP, WHITE))); - assert((pos.pieces(KNIGHT, BLACK) | pos.pieces(BISHOP, BLACK))); + assert((pos.pieces(WHITE, KNIGHT) | pos.pieces(WHITE, BISHOP))); + assert((pos.pieces(BLACK, KNIGHT) | pos.pieces(BLACK, BISHOP))); if ( pos.piece_count(WHITE, BISHOP) + pos.piece_count(WHITE, KNIGHT) <= 2 && pos.piece_count(BLACK, BISHOP) + pos.piece_count(BLACK, KNIGHT) <= 2) @@ -145,7 +145,7 @@ MaterialEntry* MaterialTable::probe(const Position& pos) { // scaling functions and we need to decide which one to use. EndgameBase* sf; - if ((sf = endgames.probe(key)) != NULL) + if (endgames.probe(key, sf)) { e->scalingFunction[sf->color()] = sf; return e;