X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=moves.c;h=6310201c0a89671a6bb8704895a1c8a501bb03ab;hb=a93282aa572ad484167d9d4205402197f8a42512;hp=e70df086b90ec172d3a1d9873c58177d9b60d9c6;hpb=a521dad8087bf19c9d4f5dee12ac8f01a5b865df;p=xboard.git diff --git a/moves.c b/moves.c index e70df08..6310201 100644 --- a/moves.c +++ b/moves.c @@ -1003,6 +1003,7 @@ int CheckTest(board, flags, rf, ff, rt, ft, enPassant) for (cl.fking = BOARD_LEFT+0; cl.fking < BOARD_RGHT; cl.fking++) for (cl.rking = 0; cl.rking < BOARD_HEIGHT; cl.rking++) { if (board[cl.rking][cl.fking] == king) { + cl.check = 0; if(gameInfo.variant == VariantXiangqi) { /* [HGM] In Xiangqi opposing Kings means check as well */ int i, dir; @@ -1013,7 +1014,6 @@ int CheckTest(board, flags, rf, ff, rt, ft, enPassant) board[i][cl.fking] == (dir>0 ? BlackWazir : WhiteWazir) ) cl.check++; } - cl.check = 0; GenPseudoLegal(board, flags ^ F_WHITE_ON_MOVE, CheckTestCallback, (VOIDSTAR) &cl); if(gameInfo.variant != VariantSpartan || cl.check == 0) // in Spartan Chess go on to test if other King is checked too goto undo_move; /* 2-level break */