From: H.G.Muller Date: Wed, 28 Dec 2016 18:26:47 +0000 (+0100) Subject: Suppress check test after null move X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=3c8dce920afe1b8164c8bf8ce582cce0de9735ff;p=crazywa.git 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). --- 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