Reset move entry on stepping through game
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sat, 4 Oct 2014 17:39:06 +0000 (19:39 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Wed, 8 Oct 2014 16:38:11 +0000 (18:38 +0200)
A forward or backward step through the game after selecting a from-square
did not erase the latter, so that it became impossible to select a
from-square for an opponent move, as it would be interpreted as the
to-square for the patially entered move. This was especially annoying
with legality testing off, as the legality test there, based on the
square markings, does not reset the entry state either, but waits
until you do click a legal to-square, so that you had to attempt
moving with pieces of the side not to move to get out of this state.
Now stepping through another position will reset the move-entry state
completely, always considering the first click a from-square selection.

backend.c

index faf0b54..bedeead 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -15524,6 +15524,7 @@ ForwardInner (int target)
 
     seekGraphUp = FALSE;
     MarkTargetSquares(1);
+    fromX = fromY = killX = killY = -1; // [HGM] abort any move entry in progress
 
     if (gameMode == PlayFromGameFile && !pausing)
       PauseEvent();
@@ -15642,6 +15643,7 @@ BackwardInner (int target)
     if (gameMode == EditPosition) return;
     seekGraphUp = FALSE;
     MarkTargetSquares(1);
+    fromX = fromY = killX = killY = -1; // [HGM] abort any move entry in progress
     if (currentMove <= backwardMostMove) {
        ClearHighlights();
        DrawPosition(full_redraw, boards[currentMove]);