From: H.G.Muller Date: Sun, 27 Nov 2016 22:35:24 +0000 (+0100) Subject: Only consider kingless positions as in-check in Atomic X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=9d4c9573bfe66d04681f0bc4553ec379e7ac1fc4;hp=ee1cf2b0aed77898937716e85c8e3e7d6361389b;p=xboard.git Only consider kingless positions as in-check in Atomic The check test returned 1000 (as special version of TRUE) when there was no King that could be exposed to capture, under the assumption that this would mean it had been exploded by the preceding move. But this was counter-productive in variants without King (such as Horde). So now it is only done in Atomic Chess, and all other variants return FALSE if there is nothing on the board that could be checked. --- diff --git a/moves.c b/moves.c index 876564c..30f94b5 100644 --- a/moves.c +++ b/moves.c @@ -1768,10 +1768,10 @@ CheckTest (Board board, int flags, int rf, int ff, int rt, int ft, int enPassant /* For compatibility with ICS wild 9, we scan the board in the order a1, a2, a3, ... b1, b2, ..., h8 to find the first king, and we test only whether that one is in check. */ + cl.check = 0; 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; @@ -1806,7 +1806,7 @@ CheckTest (Board board, int flags, int rf, int ff, int rt, int ft, int enPassant board[EP_STATUS] = ep; } - return cl.fking < BOARD_RGHT ? cl.check : 1000; // [HGM] atomic: return 1000 if we have no king + return cl.fking < BOARD_RGHT ? cl.check : (gameInfo.variant == VariantAtomic)*1000; // [HGM] atomic: return 1000 if we have no king } int