From 79eb4f2ca3c883e02bf530d6de60c8962a14cb7d Mon Sep 17 00:00:00 2001
From: H.G. Muller <h.g.muller@hccnet.nl>
Date: Thu, 28 Oct 2010 13:53:51 +0200
Subject: [PATCH] Suppress promotion popup if piece will explode

In atomic, a Pawn capture to last rank is not really a promotion.
Fix choice to Queen.
---
 backend.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

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
-- 
1.7.0.4