X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=42c1adff71591a270148adb43b37d2588cd2fe29;hp=b6dc31b4ed0cfa6271d719da333f3c4d94a4ad05;hb=ba4e215493de31263b9bd352af79d00193e545bf;hpb=043a469f83b4c81f94ab991029b4cd49fb05452e diff --git a/src/position.cpp b/src/position.cpp index b6dc31b4..42c1adff 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -272,7 +272,7 @@ Position& Position::set(const string& fenStr, bool isChess960, StateInfo* si, Th // 5-6. Halfmove clock and fullmove number ss >> std::skipws >> st->rule50 >> gamePly; - // Convert from fullmove starting from 1 to ply starting from 0, + // Convert from fullmove starting from 1 to gamePly starting from 0, // handle also common incorrect FEN with fullmove = 0. gamePly = std::max(2 * (gamePly - 1), 0) + (sideToMove == BLACK); @@ -1071,11 +1071,10 @@ bool Position::is_draw(int ply) const { { stp = stp->previous->previous; - // At root position ply is 1, so return a draw score if a position - // repeats once earlier but strictly after the root, or repeats twice - // before or at the root. + // Return a draw score if a position repeats once earlier but strictly + // after the root, or repeats twice before or at the root. if ( stp->key == st->key - && ++cnt + (ply - 1 > i) == 2) + && ++cnt + (ply > i) == 2) return true; }