X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=0336a832a363291d4c07d5ade63899db790a9bca;hp=2508db669dfb2241ed0e4c322fbfb6fbd8d0cfe0;hb=34c7f1387d514176996144020ac6ac0c603fca4b;hpb=cfe59de27ddc42ac555187ae68879f2bc7bd7936 diff --git a/src/position.cpp b/src/position.cpp index 2508db66..0336a832 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1678,6 +1678,7 @@ Value Position::compute_non_pawn_material(Color c) const { /// Position::is_draw() tests whether the position is drawn by material, /// repetition, or the 50 moves rule. It does not detect stalemates, this /// must be done by the search. +// FIXME: Currently we are not handling 50 move rule correctly when in check bool Position::is_draw() const { @@ -1691,7 +1692,7 @@ bool Position::is_draw() const { return true; // Draw by repetition? - for (int i = 2; i < Min(Min(gamePly, st->rule50), st->pliesFromNull); i += 2) + for (int i = 4; i <= Min(Min(gamePly, st->rule50), st->pliesFromNull); i += 2) if (history[gamePly - i] == st->key) return true;