From: H.G.Muller Date: Tue, 2 Feb 2016 12:10:24 +0000 (+0100) Subject: Fix setting default piece from 'choice' command X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=adbd00423d43ae48eaab4bb21183284c93d6b20b;hp=f439f9680ca51033a0d99b777a994223a041f763;p=xboard.git Fix setting default piece from 'choice' command PieceToCharwas used instead of CharToPiece. In addition it is important to deduce the color from currentMoe rather than forwardMostMove, as one could be entering a move in the middle of a game (e.g. when editing or starting a variation). --- diff --git a/backend.c b/backend.c index da945a6..c2a5bfc 100644 --- a/backend.c +++ b/backend.c @@ -9084,7 +9084,7 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h return; } if(sscanf(message, "choice %s", promoRestrict) == 1 && promoSweep != EmptySquare) { - promoSweep = PieceToChar(forwardMostMove&1 ? ToLower(*promoRestrict) : ToUpper(*promoRestrict)); + promoSweep = CharToPiece(currentMove&1 ? ToLower(*promoRestrict) : ToUpper(*promoRestrict)); Sweep(0); return; }