X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmaterial.cpp;h=44700f815d8017a9f2539c3d64f4731b3028d3f6;hp=11fd3c9b235cfe5ba8baaa542694186f69a6aa9a;hb=dae4e7df07061c01c60bee182cf7e54f4743beb8;hpb=f178f0a2912082e2e9d07d9b0926031322d78f67 diff --git a/src/material.cpp b/src/material.cpp index 11fd3c9b..44700f81 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -237,6 +237,18 @@ MaterialInfo* MaterialInfoTable::get_material_info(const Position& pos) { } } + // Compute the space weight + if (pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK) >= + 2*QueenValueMidgame + 4*RookValueMidgame + 2*KnightValueMidgame) + { + int minorPieceCount = pos.piece_count(WHITE, KNIGHT) + + pos.piece_count(BLACK, KNIGHT) + + pos.piece_count(WHITE, BISHOP) + + pos.piece_count(BLACK, BISHOP); + + mi->spaceWeight = minorPieceCount * minorPieceCount; + } + // Evaluate the material balance int sign;