From: H.G. Muller Date: Thu, 28 Oct 2010 11:53:51 +0000 (+0200) Subject: Suppress promotion popup if piece will explode X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=79eb4f2ca3c883e02bf530d6de60c8962a14cb7d;p=xboard.git Suppress promotion popup if piece will explode In atomic, a Pawn capture to last rank is not really a promotion. Fix choice to Queen. --- diff --git a/backend.c b/backend.c index d94da90..6c18a36 100644 --- a/backend.c +++ b/backend.c @@ -5721,6 +5721,11 @@ HasPromotionChoice(int fromX, int fromY, int toX, int toY, char *promoChoice) *promoChoice = PieceToChar(BlackFerz); // no choice return FALSE; } + // no sense asking what we must promote to if it is going to explode... + if(gameInfo.variant == VariantAtomic && boards[currentMove][toY][toX] != EmptySquare) { + *promoChoice = PieceToChar(BlackQueen); // Queen as good as any + return FALSE; + } if(autoQueen) { // predetermined if(gameInfo.variant == VariantSuicide || gameInfo.variant == VariantLosers) *promoChoice = PieceToChar(BlackKing); // in Suicide Q is the last thing we want