X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=0e249705fa59a89e00d1f689d714bf33bbe024f9;hb=9da1f45b1d310fbe213a7f51916e098fba837a9a;hp=1b6cf365b427ca10e38252896666bb8f302879ea;hpb=5405efabcbd1b60f64a5d88b596178dcf92e98e4;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 1b6cf365..0e249705 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -149,7 +149,7 @@ namespace { void set_non_pv_scores(const Position& pos); void sort() { insertion_sort(begin(), end()); } - void sort_multipv(int n) { insertion_sort(begin(), begin() + n); } + void sort_multipv(int n) { insertion_sort(begin(), begin() + n + 1); } }; @@ -513,6 +513,9 @@ bool think(Position& pos, bool infinite, bool ponder, int time[], int increment[ << move_to_san(pos, ponderMove) // Works also with MOVE_NONE << endl; + // Return from think() with unchanged position + pos.undo_move(bestMove); + LogFile.close(); } @@ -903,7 +906,7 @@ namespace { // Write PV lines to transposition table, in case the relevant entries // have been overwritten during the search. - for (int i = 0; i < MultiPV; i++) + for (int i = 0; i < Min(MultiPV, (int)rml.size()); i++) rml[i].insert_pv_in_tt(pos); return alpha;