X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=6ee1ea02a17b1e45d9dc603a75ec23a6d8e0d50e;hb=2572055c87f04832e43d63f30f26de04cadb729c;hp=5e04dbb7b696cc874f63641c2643f9ca34f9653d;hpb=c6ba14b7c939fd212d002d5f4385219c5ffec53f;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 5e04dbb7..6ee1ea02 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1675,7 +1675,7 @@ namespace { if ( !PvNode && !captureOrPromotion && !isCheck - && !dangerous + && !dangerous && !move_is_castle(move)) { // Move count based pruning @@ -1717,7 +1717,7 @@ namespace { ss->reduction = reduction(sp->depth, moveCount); if (ss->reduction) { - Value localAlpha = sp->alpha; + Value localAlpha = sp->alpha; Depth d = newDepth - ss->reduction; value = d < OnePly ? -qsearch(pos, ss+1, -(localAlpha+1), -localAlpha, Depth(0), threadID) : - search(pos, ss+1, -(localAlpha+1), -localAlpha, d, true, threadID); @@ -1736,12 +1736,12 @@ namespace { value = -search(pos, ss+1, -(localAlpha+1), -localAlpha, newDepth-ss->reduction, true, threadID); doFullDepthSearch = (value > localAlpha); } + ss->reduction = Depth(0); // Restore original reduction } // Step 15. Full depth search if (doFullDepthSearch) { - ss->reduction = Depth(0); Value localAlpha = sp->alpha; value = newDepth < OnePly ? -qsearch(pos, ss+1, -(localAlpha+1), -localAlpha, Depth(0), threadID) : - search(pos, ss+1, -(localAlpha+1), -localAlpha, newDepth, true, threadID);