X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmaterial.cpp;h=ffc549ca6962bb637e9d23059bb991a76f792563;hp=e19b0c9e4225f9636821a9f841793184a01a106c;hb=94b9c65e09b5d396bebb29b62d9979139b5fbdfa;hpb=f26e0fec64eed03279704e851b11c1654ea2c63c diff --git a/src/material.cpp b/src/material.cpp index e19b0c9e..ffc549ca 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -72,7 +72,7 @@ namespace { // Helper templates used to detect a given material distribution template bool is_KXK(const Position& pos) { const Color Them = (Us == WHITE ? BLACK : WHITE); - return pos.non_pawn_material(Them) == Value(0) + return pos.non_pawn_material(Them) == VALUE_ZERO && pos.piece_count(Them, PAWN) == 0 && pos.non_pawn_material(Us) >= RookValueMidgame; } @@ -254,7 +254,7 @@ MaterialInfo* MaterialInfoTable::get_material_info(const Position& pos) { else if (is_KQKRPs(pos)) mi->scalingFunction[BLACK] = &ScaleKQKRPs[BLACK]; - if (pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK) == Value(0)) + if (pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK) == VALUE_ZERO) { if (pos.piece_count(BLACK, PAWN) == 0) {