Fix Tsume mode speed regression
authorFabian Fichter <ianfab@users.noreply.github.com>
Wed, 15 Jan 2020 20:06:22 +0000 (21:06 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Wed, 15 Jan 2020 20:06:22 +0000 (21:06 +0100)
src/position.cpp

index 63e37df..9d4575d 100644 (file)
@@ -1927,7 +1927,7 @@ bool Position::is_immediate_game_end(Value& result, int ply) const {
       }
   }
   // Tsume mode: Assume that side with king wins when not in check
-  if (Options["TsumeMode"] && count<KING>(sideToMove) && !checkers())
+  if (!count<KING>(~sideToMove) && count<KING>(sideToMove) && !checkers() && Options["TsumeMode"])
   {
       result = mate_in(ply);
       return true;