From: H.G. Muller Date: Sun, 23 Aug 2009 00:30:05 +0000 (-0700) Subject: fix premove for winboard X-Git-Tag: v4.4.0.beta2~21 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=8bac62c70d682a8dbdb029af5fa80660979821e2;hp=c560bfa01c217889fde6b3b5cb8692356680178d;p=xboard.git fix premove for winboard This might fix the illusive premove problem. In 4.2.7 the code was not properly indented, and this led to an unbalanced braces error that I then fixed the wrong way. Click-click premoves did only work after clicking the toSquare twice. It might be that they actually did work after clicking it once, but that the highlights were not displayed (although set) for lack of a display refresh. --- diff --git a/winboard/winboard.c b/winboard/winboard.c index 21d731d..a17e4ac 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -5140,23 +5140,20 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) ClearHighlights(); } FinishMove(moveType, fromX, fromY, toX, toY, NULLCHAR); - fromX = fromY = -1; if (appData.animate && !appData.highlightLastMove) { ClearHighlights(); DrawPosition(forceFullRepaint || FALSE, NULL); } } - break; + fromX = fromY = -1; + break; } if (gotPremove) { - /* [HGM] it seemed that braces were missing here */ - SetPremoveHighlights(fromX, fromY, toX, toY); - fromX = fromY = -1; - break; - } - } - ClearHighlights(); - DrawPosition(forceFullRepaint || FALSE, NULL); + SetPremoveHighlights(fromX, fromY, toX, toY); + DrawPosition(forceFullRepaint || FALSE, NULL); + } else ClearHighlights(); + fromX = fromY = -1; + DrawPosition(forceFullRepaint || FALSE, NULL); } /* First downclick, or restart on a square with same color piece */ if (!frozen && OKToStartUserMove(x, y)) {