diff --git a/src/movepicker.c b/src/movepicker.c index dc7a0dcb..d93f8bad 100644 --- a/src/movepicker.c +++ b/src/movepicker.c @@ -159,7 +159,8 @@ void InitNoisyMP(MovePicker *mp, Thread *thread, Stack *ss, Move ttMove) { mp->onlyNoisy = true; } -void InitProbcutMP(MovePicker *mp, Thread *thread, Stack *ss, int threshold) { - InitNoisyMP(mp, thread, ss, NOMOVE); +void InitProbcutMP(MovePicker *mp, Thread *thread, Stack *ss, Move ttMove, int threshold) { + Position *pos = &thread->pos; + InitNoisyMP(mp, thread, ss, ttMove && SEE(pos, ttMove, threshold) ? ttMove : NOMOVE); mp->threshold = threshold; } diff --git a/src/movepicker.h b/src/movepicker.h index 0c94f78c..a61a5da7 100644 --- a/src/movepicker.h +++ b/src/movepicker.h @@ -41,4 +41,4 @@ typedef struct MovePicker { Move NextMove(MovePicker *mp); void InitNormalMP(MovePicker *mp, Thread *thread, Stack *ss, Depth depth, Move ttMove, Move killer); void InitNoisyMP(MovePicker *mp, Thread *thread, Stack *ss, Move ttMove); -void InitProbcutMP(MovePicker *mp, Thread *thread, Stack *ss, int threshold); +void InitProbcutMP(MovePicker *mp, Thread *thread, Stack *ss, Move ttMove, int threshold); diff --git a/src/search.c b/src/search.c index 4cba415e..702a8f0f 100644 --- a/src/search.c +++ b/src/search.c @@ -398,7 +398,7 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth if ( depth >= 5 && (!ttHit || ttBound == BOUND_LOWER || ttScore >= probCutBeta)) { - InitProbcutMP(&mp, thread, ss, probCutBeta - ss->staticEval); + InitProbcutMP(&mp, thread, ss, ttMove, probCutBeta - ss->staticEval); Move move; while ((move = NextMove(&mp))) {