X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=moves.c;h=fd05e384e4bfdd5f5cb75604ee047db47c593905;hb=a90c45ee54a358b17fa4d006417bab8c6cf8657e;hp=e70df086b90ec172d3a1d9873c58177d9b60d9c6;hpb=a521dad8087bf19c9d4f5dee12ac8f01a5b865df;p=xboard.git diff --git a/moves.c b/moves.c index e70df08..fd05e38 100644 --- a/moves.c +++ b/moves.c @@ -126,6 +126,7 @@ ChessSquare CharToPiece(c) int c; { int i; + if(c == '.') return EmptySquare; for(i=0; i< (int) EmptySquare; i++) if(pieceNickName[i] == c) return (ChessSquare) i; for(i=0; i< (int) EmptySquare; i++) @@ -1003,6 +1004,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 +1015,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 */