From: H.G.Muller Date: Wed, 1 Jan 2020 19:17:46 +0000 (+0100) Subject: Suppress testing of holdings in holdingless seirawan X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=c971f92e3495ecbd1f78bfc9b2a9aeff279afab5;p=xboard.git Suppress testing of holdings in holdingless seirawan The legality test in variant seirawan normally tests if a piece specified for gating is indeed in hand. This is now suppressed if there are no holdings. There is no check on the correctness of the indicated gating piece at all now, in that case. But presence of the suffix is still necessary to trigger the gating of the piece that should be gated. --- diff --git a/moves.c b/moves.c index 726dfd2..638a4c0 100644 --- a/moves.c +++ b/moves.c @@ -1938,6 +1938,7 @@ LegalityTest (Board board, int flags, int rf, int ff, int rt, int ft, int promoC if(promoChar == 'x') promoChar = NULLCHAR; // [HGM] is this ever the case? if(autoProm[piece]) promoChar = NULLCHAR; // ignore promotion characters on auto-promoting pieces if(gameInfo.variant == VariantSChess && promoChar && promoChar != '=' && board[rf][ff] != WhitePawn && board[rf][ff] != BlackPawn) { + if(gameInfo.holdingsSize) { if(board[rf][ff] < BlackPawn) { // white if(rf != 0) return IllegalMove; // must be on back rank if(!(board[VIRGIN][ff] & VIRGIN_W)) return IllegalMove; // non-virgin @@ -1951,6 +1952,7 @@ LegalityTest (Board board, int flags, int rf, int ff, int rt, int ft, int promoC if(cl.kind == BlackHSideCastleFR && (ff == BOARD_RGHT-2 || ff == BOARD_RGHT-3)) return ImpossibleMove; if(cl.kind == BlackASideCastleFR && (ff == BOARD_LEFT+2 || ff == BOARD_LEFT+3)) return ImpossibleMove; } + } } else if(gameInfo.variant == VariantChu) { if(cl.kind != NormalMove || promoChar == NULLCHAR || promoChar == '=') return cl.kind;