From d262a3a81289ce108a1f62a4c31292cb6840b132 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 2 Feb 2016 17:34:53 +0100 Subject: [PATCH] Fix default piece in Shogi promotions In Shogi the default should be promotion, but it was using Queen like the other variants. As the +/= issue was decided based on comparing this default promotion piece with the moved piece, the Lance (which internally is represented by Queen) would by default defer. Now the up-click of a drag-drop move (which would bypass sweep selection) sets the default choice to the promoted partner if the pieceToCharTable specifies one. --- backend.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/backend.c b/backend.c index fd730e9..2ccc54d 100644 --- a/backend.c +++ b/backend.c @@ -7792,6 +7792,8 @@ LeftClick (ClickType clickType, int xPix, int yPix) ClearHighlights(); } #endif + if(PieceToChar(CHUPROMOTED(boards[currentMove][fromY][fromX])) == '+') + defaultPromoChoice = CHUPROMOTED(boards[currentMove][fromY][fromX]); if(gameInfo.variant == VariantChuChess && piece != WhitePawn && piece != BlackPawn) defaultPromoChoice = piece; if(marker[y][x] == 5) { // [HGM] lion: this was the release of a to-click or drag on a cyan square dragging *= 2; // flag button-less dragging if we are dragging -- 1.7.0.4