}
if(maxDepth <= 0 && board[toDecode[hashMove&255]] == 0) hashMove = 0;
} else if(curEval >= beta && f.checker == CK_NONE) {
- int nullDepth = (depth > 3 ? depth - 3 : 0);
- f.mutation = -1; // kludge to suppress testing for discovered check
+ int nullDepth = depth - 3;
+ if(nullDepth < 0) nullDepth = 0;
+ f.mutation = -2; // kludge to suppress testing for discovered check
f.newEval = f.pstEval;
f.newKey = f.hashKey;
+ f.epSqr = -1; f.fromSqr = f.toSqr = f.captSqr = 1; f.toPiece = board[1];
deprec[ply] = maxDepth << 16 | depth << 8; path[ply++] = 0;
- score = -Search(stm, -alpha-1, -alpha, &f, nullDepth, 0, nullDepth);
+ score = -Search(stm, -beta, 1-beta, &f, nullDepth, 0, nullDepth);
ply--;
if(score >= beta) { ff->depth = f.depth + originalReduction + 3; moveSP = oldSP; return beta + 1; }
}