Skip to content

Commit 157c552

Browse files
author
geko
committed
fix bug mate in draw
1 parent 84ae34f commit 157c552

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Search.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,15 +408,12 @@ int Search::search(int depth, int alpha, int beta, _TpvLine *pline, int N_PIECE,
408408
int extension = 0;
409409
int is_incheck_side = inCheck<side>();
410410
if (!is_incheck_side && depth != mainDepth) {
411-
if (checkInsufficientMaterial(N_PIECE)) {
411+
if (checkInsufficientMaterial(N_PIECE) || checkDraw(chessboard[ZOBRISTKEY_IDX])) {
412412
if (inCheck<side ^ 1>()) {
413413
return _INFINITE - (mainDepth - depth + 1);
414414
}
415415
return -lazyEval<side>() * 2;
416416
}
417-
if (checkDraw(chessboard[ZOBRISTKEY_IDX])) {
418-
return -lazyEval<side>() * 2;
419-
}
420417
}
421418
if (is_incheck_side) {
422419
extension++;

0 commit comments

Comments
 (0)