Reset to starting position on protocol change
authorFabian Fichter <ianfab@users.noreply.github.com>
Fri, 12 Mar 2021 09:48:45 +0000 (10:48 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Fri, 12 Mar 2021 09:48:45 +0000 (10:48 +0100)
Prevents issues with non-compliant GUIs not sending position command.

src/uci.cpp

index 0ab6275..524b081 100644 (file)
@@ -318,6 +318,8 @@ void UCI::loop(int argc, char* argv[]) {
 #endif
                                                            : "chess");
           Options["UCI_Variant"].set_default(defaultVariant);
+          std::istringstream ss("startpos");
+          position(pos, ss, states);
           if (token == "uci" || token == "usi" || token == "ucci")
               sync_cout << "id name " << engine_info(true)
                           << "\n" << Options