From 3c8dce920afe1b8164c8bf8ce582cce0de9735ff Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 28 Dec 2016 19:26:47 +0100 Subject: [PATCH] Suppress check test after null move After null move we should never be in check, but the test for determining it would use variables that might not be initialized (like to-square). Make sure we indicate there is no check (also in checkDist, which is used testing for distant checks). --- dropper.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dropper.c b/dropper.c index 0510ee8..d755acf 100644 --- a/dropper.c +++ b/dropper.c @@ -871,6 +871,7 @@ DiscoTest (int stm, int fromSqr, int king, StackFrame *f) void CheckTest (int stm, StackFrame *ff, StackFrame *f) { + if(ff->mutation == -2) f.checker = CK_NONE, f.checkDist = 0; else { // null move never checks int king = location[stm+31]; // own King int vec = king - ff->toSqr; int match = captCode[vec] & pieceCode[ff->toPiece]; @@ -884,6 +885,7 @@ CheckTest (int stm, StackFrame *ff, StackFrame *f) DiscoTest(stm, ff->fromSqr, king, ff); if(board[ff->captSqr] == 0) DiscoTest(stm, ff->captSqr, king, ff); // e.p. capture can discover check as well } + } } int -- 1.7.0.4