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).
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];
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