From: H.G. Muller Date: Thu, 14 Apr 2011 10:31:15 +0000 (+0200) Subject: Fix sweep-promotions patch X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=2f639b510cfc1a6f686919baa024bd7613f9a095;p=xboard.git Fix sweep-promotions patch Setting of the from square was moved to before OKtoStartUserMove in the LeftClick handler, to make sure we could test the promotion possiblity when OnlyMove() would have altered (x,y) to be no longer the from square. But this setting of fromX, fromY hung on also if the move was not OK, so you could effectively select opponent pieces and empty squares. The from-square is now set back to undefined when it is not OK to move the piece you clicked. --- diff --git a/backend.c b/backend.c index 1165932..9f9f63e 100644 --- a/backend.c +++ b/backend.c @@ -6541,7 +6541,7 @@ void LeftClick(ClickType clickType, int xPix, int yPix) if (appData.highlightDragging) { SetHighlights(fromX, fromY, -1, -1); } - } + } else fromX = fromY = -1; return; } }