diff --git a/src/material.cpp b/src/material.cpp index b6e23964..89147352 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -192,7 +192,7 @@ Entry* probe(const Position& pos, Table& entries, Endgames& endgames) { Value npm_w = pos.non_pawn_material(WHITE); Value npm_b = pos.non_pawn_material(BLACK); - if (npm_w + npm_b == VALUE_ZERO) + if (npm_w + npm_b == VALUE_ZERO && pos.pieces(PAWN)) { if (!pos.count(BLACK)) { diff --git a/src/position.cpp b/src/position.cpp index 6f874763..72681e8d 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1176,7 +1176,7 @@ Key Position::compute_material_key() const { Key k = 0; for (Color c = WHITE; c <= BLACK; ++c) - for (PieceType pt = PAWN; pt <= QUEEN; ++pt) + for (PieceType pt = PAWN; pt <= KING; ++pt) for (int cnt = 0; cnt < pieceCount[c][pt]; ++cnt) k ^= Zobrist::psq[c][pt][cnt];