From 65df48bbda07eaae45b04b76dfac1a9e086338b6 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 24 Dec 2011 17:51:22 +0100 Subject: [PATCH] Fix legality of Spartan promotion to king In the check test promotion to King is only allowed if there are not yet 2 kings. --- moves.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) 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); -- 1.7.0.4