From adb312209d7cbef4947f13c9120bfb253da79bcc Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 13 Feb 2011 23:49:44 +0100 Subject: [PATCH] Fix Xiangqi King facing The Spartan patch had broken the CheckTest for Xiangqi, because cl.check was cleared after the King-facing test, rather than before it. --- moves.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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 */ -- 1.7.0.4