X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=4c8145c490f508d68375298a0180243bd1646bd1;hp=03d8bf8ce5f796da279297306f61104165afbc51;hb=6d89d0b64a99003576d3e0ed616b43333c9eca01;hpb=25296547d0258f8519b7614e4474bbc947eaea04 diff --git a/src/position.cpp b/src/position.cpp index 03d8bf8c..4c8145c4 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -65,7 +65,7 @@ PieceType min_attacker(const Bitboard* bb, Square to, Bitboard stmAttackers, Bitboard b = stmAttackers & bb[Pt]; if (!b) - return min_attacker(bb, to, stmAttackers, occupied, attackers); + return min_attacker(bb, to, stmAttackers, occupied, attackers); occupied ^= b & ~(b - 1); @@ -1100,10 +1100,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 after or at the root, or repeats twice - // strictly before the root. + // repeats once earlier but strictly after the root, or repeats twice + // before or at the root. if ( stp->key == st->key - && ++cnt + (ply - i > 0) == 2) + && ++cnt + (ply - 1 > i) == 2) return true; }