X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=210a1ba9d7ad09358800770c89de02d4a90ed966;hp=5193d20e85c89c8207935559d3a0d60d6ab3e780;hb=43f67eab5f55508e07e4e3d7cec885dc4e82036f;hpb=a95cbca568ec393ea6b4b17ed86f89c75d7cbe57 diff --git a/src/position.cpp b/src/position.cpp index 5193d20e..210a1ba9 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1376,7 +1376,6 @@ 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. -template bool Position::is_draw() const { // Draw by material? @@ -1389,33 +1388,26 @@ bool Position::is_draw() const { return true; // Draw by repetition? - if (!SkipRepetition) - { - int i = 4, e = std::min(st->rule50, st->pliesFromNull); + int i = 4, e = std::min(st->rule50, st->pliesFromNull); - if (i <= e) - { - StateInfo* stp = st->previous->previous; + if (i <= e) + { + StateInfo* stp = st->previous->previous; - do { - stp = stp->previous->previous; + do { + stp = stp->previous->previous; - if (stp->key == st->key) - return true; + if (stp->key == st->key) + return true; - i += 2; + i += 2; - } while (i <= e); - } + } while (i <= e); } return false; } -// Explicit template instantiations -template bool Position::is_draw() const; -template bool Position::is_draw() const; - /// Position::flip() flips position with the white and black sides reversed. This /// is only useful for debugging especially for finding evaluation symmetry bugs.