From fcc27e54a113cbdcf20e242ad3527c50cfea69b8 Mon Sep 17 00:00:00 2001 From: Aryan1508 <68417405+Aryan1508@users.noreply.github.com> Date: Sat, 19 Jun 2021 23:29:01 +0530 Subject: [PATCH] Clear hash on ucinewgame --- Bit-Genie/src/uci.cpp | 8 +++++++- Bit-Genie/src/uciparse.cpp | 3 +++ Bit-Genie/src/uciparse.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Bit-Genie/src/uci.cpp b/Bit-Genie/src/uci.cpp index 6dba971..c12bd9c 100644 --- a/Bit-Genie/src/uci.cpp +++ b/Bit-Genie/src/uci.cpp @@ -25,7 +25,7 @@ #include "benchmark.h" #include "searchinit.h" -const char *version = "5.45"; +const char *version = "5.5"; namespace { @@ -181,5 +181,11 @@ void uci_input_loop(int argc, char **argv) table.reset(); BenchMark::bench(position, table); } + + else if (command == UciCommands::ucinewgame) + { + uci_stop(worker); + table.reset(); + } } } \ No newline at end of file diff --git a/Bit-Genie/src/uciparse.cpp b/Bit-Genie/src/uciparse.cpp index 90df1f5..ef7f1a9 100644 --- a/Bit-Genie/src/uciparse.cpp +++ b/Bit-Genie/src/uciparse.cpp @@ -74,6 +74,9 @@ bool UciParser::operator==(UciCommands type) const case UciCommands::bench: return command == "bench"; + case UciCommands::ucinewgame: + return command == "ucinewgame"; + default: return false; break; diff --git a/Bit-Genie/src/uciparse.h b/Bit-Genie/src/uciparse.h index 2f1b77f..2c4e948 100644 --- a/Bit-Genie/src/uciparse.h +++ b/Bit-Genie/src/uciparse.h @@ -29,6 +29,7 @@ enum class UciCommands go, stop, setoption, + ucinewgame, // *debugging/other purpose commands* print,