From b9942fbfad217952a1135345d47860be3ebee6a6 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sun, 18 Feb 2018 11:20:09 +0100 Subject: [PATCH] Fix board corruption on null move 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. --- dropper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dropper.c b/dropper.c index 8261873..742f8ec 100644 --- a/dropper.c +++ b/dropper.c @@ -1223,7 +1223,7 @@ Search (int stm, int alpha, int beta, StackFrame *ff, int depth, int reduction, 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--; -- 1.7.0.4