]> git.sesse.net Git - stockfish/commitdiff
Bugfix: KRK was not classified as KNOWN_WIN
authorJoona Kiiski <joona.kiiski@gmail.com>
Wed, 17 Jun 2009 08:07:16 +0000 (11:07 +0300)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 18 Jun 2009 06:35:24 +0000 (07:35 +0100)
Problem is that npMaterial is compared to _endgame_ value
of rook, although npMaterial is always (also in endgame!)
calculated using _middlegame_ values.

Bug was hidden as long as Rook middlegame
and endgame values were same.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/material.cpp

index f3d22776f78e5d8f2740a20f567008d7ab8ab5ed..845519bc41648cedd2a7933564d4307b5ceafffa 100644 (file)
@@ -143,14 +143,14 @@ MaterialInfo* MaterialInfoTable::get_material_info(const Position& pos) {
 
   else if (   pos.non_pawn_material(BLACK) == Value(0)
            && pos.piece_count(BLACK, PAWN) == 0
 
   else if (   pos.non_pawn_material(BLACK) == Value(0)
            && pos.piece_count(BLACK, PAWN) == 0
-           && pos.non_pawn_material(WHITE) >= RookValueEndgame)
+           && pos.non_pawn_material(WHITE) >= RookValueMidgame)
   {
       mi->evaluationFunction = &EvaluateKXK;
       return mi;
   }
   else if (   pos.non_pawn_material(WHITE) == Value(0)
            && pos.piece_count(WHITE, PAWN) == 0
   {
       mi->evaluationFunction = &EvaluateKXK;
       return mi;
   }
   else if (   pos.non_pawn_material(WHITE) == Value(0)
            && pos.piece_count(WHITE, PAWN) == 0
-           && pos.non_pawn_material(BLACK) >= RookValueEndgame)
+           && pos.non_pawn_material(BLACK) >= RookValueMidgame)
   {
       mi->evaluationFunction = &EvaluateKKX;
       return mi;
   {
       mi->evaluationFunction = &EvaluateKKX;
       return mi;