Start ASEAN counting from zero
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 19 Apr 2020 10:52:52 +0000 (12:52 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 19 Apr 2020 10:52:52 +0000 (12:52 +0200)
Starting from the piece count only applies to Makruk, not to ASEAN.

Closes #104.

src/position.cpp

index a9225e8..44d5401 100644 (file)
@@ -1434,7 +1434,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
       && counting_limit())
   {
       st->countingLimit = 2 * counting_limit();
-      st->countingPly = count<ALL_PIECES>(sideToMove) == 1 ? 2 * count<ALL_PIECES>() : 0;
+      st->countingPly = counting_rule() == MAKRUK_COUNTING && count<ALL_PIECES>(sideToMove) == 1 ? 2 * count<ALL_PIECES>() : 0;
   }
 
   // Update king attacks used for fast check detection