+
+ if (nullCapturePruning && !mateThreat)
+ {
+ // The null move failed low due to a suspicious capture. Verify if
+ // position is really dangerous or we are facing a null capture
+ // artifact due to the side to move change. So search this
+ // position with a reduced depth and see if we still fail low.
+ Move tm = ss[ply].threatMove;
+
+ assert(tm != MOVE_NONE);
+
+ Value v = search(pos, ss, beta, depth-3*OnePly, ply, false, threadID);
+ if (v >= beta)
+ return beta;
+
+ // Restore stack and update ttMove if was empty
+ ss[ply].threatMove = tm;
+ if (ttMove == MOVE_NONE)
+ ttMove = ss[ply].pv[ply];
+ }