Faking a piece other than the one actually there on the to-square
of a null move interfered with the kludge for testing castling legality,
by actually putting back that piece there. Better solutions should be
possible here.
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 = stm; // fake Pawn to suppress early move gen in reply node
+ 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, -beta, 1-beta, &f, nullDepth, 0, nullDepth);
ply--;