From 9d4c9573bfe66d04681f0bc4553ec379e7ac1fc4 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sun, 27 Nov 2016 23:35:24 +0100 Subject: [PATCH] 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. --- moves.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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 -- 1.7.0.4