]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Fix no previous moves on root.
[stockfish] / src / search.cpp
index 0e82f04e9959180ecfd97151e0503c6d20b5c861..c7b00766553e96f72db634d105724453090ed4bf 100644 (file)
@@ -1489,7 +1489,7 @@ moves_loop: // When in check, search starts here
     // to search the moves. Because the depth is <= 0 here, only captures,
     // queen promotions, and other checks (only if depth >= DEPTH_QS_CHECKS)
     // will be generated.
-    Square prevSq = (ss-1)->currentMove != MOVE_NULL ? to_sq((ss-1)->currentMove) : SQ_NONE;
+    Square prevSq = is_ok((ss-1)->currentMove) ? to_sq((ss-1)->currentMove) : SQ_NONE;
     MovePicker mp(pos, ttMove, depth, &thisThread->mainHistory,
                                       &thisThread->captureHistory,
                                       contHist,