Clear transposition table on "ucinewgame"
authorMarco Costalba <mcostalba@gmail.com>
Sat, 30 Jun 2012 07:00:48 +0000 (08:00 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 30 Jun 2012 07:00:48 +0000 (08:00 +0100)
It seems the standard behaviour as implemented
in most engines although UCI protocol does not
specify what to do upon "ucinewgame" command.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/uci.cpp

index 0ba4de3bddeb3cb9dd8c87eab097ed0a41afe00c..7b7b116ee233999760f381c6e960b57a284739eb 100644 (file)
@@ -25,6 +25,7 @@
 #include "position.h"
 #include "search.h"
 #include "thread.h"
 #include "position.h"
 #include "search.h"
 #include "thread.h"
+#include "tt.h"
 #include "ucioption.h"
 
 using namespace std;
 #include "ucioption.h"
 
 using namespace std;
@@ -93,7 +94,7 @@ void uci_loop(const string& args) {
           go(pos, is);
 
       else if (token == "ucinewgame")
           go(pos, is);
 
       else if (token == "ucinewgame")
-      { /* Avoid returning "Unknown command" */ }
+          TT.clear();
 
       else if (token == "isready")
           cout << "readyok" << endl;
 
       else if (token == "isready")
           cout << "readyok" << endl;