From: H.G. Muller Date: Sat, 24 Dec 2011 16:51:22 +0000 (+0100) Subject: Fix legality of Spartan promotion to king X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=65df48bbda07eaae45b04b76dfac1a9e086338b6;p=xboard.git Fix legality of Spartan promotion to king In the check test promotion to King is only allowed if there are not yet 2 kings. --- diff --git a/moves.c b/moves.c index 093df63..199f45b 100644 --- a/moves.c +++ b/moves.c @@ -736,7 +736,15 @@ void GenLegalCallback(board, flags, kind, rf, ff, rt, ft, closure) if (!(flags & F_IGNORE_CHECK) ) { int check, promo = (gameInfo.variant == VariantSpartan && kind == BlackPromotion); - if(promo) board[rf][ff] = BlackKing; // [HGM] spartan: promote to King before check-test + if(promo) { + int r, f, kings=0; + for(r=0; r= 2) + promo = 0; + else + board[rf][ff] = BlackKing; // [HGM] spartan: promote to King before check-test + } check = CheckTest(board, flags, rf, ff, rt, ft, kind == WhiteCapturesEnPassant || kind == BlackCapturesEnPassant);