Reset move entry on Clear Board
authorH.G.Muller <hgm@hgm-xboard.(none)>
Wed, 15 Oct 2014 18:26:31 +0000 (20:26 +0200)
committerArun Persaud <arun@nubati.net>
Thu, 16 Oct 2014 03:40:20 +0000 (20:40 -0700)
The board markers would stay on when the board was cleared, and a
no-longer-present piece would stay selected, leading to deletion of the
first piece that you tried to select.

backend.c

index 1c684ad..fe70fd2 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -15078,6 +15078,8 @@ EditPositionMenuEvent (ChessSquare selection, int x, int y)
 
     switch (selection) {
       case ClearBoard:
+       fromX = fromY = killX = killY = -1; // [HGM] abort any move entry in progress
+       MarkTargetSquares(1);
        CopyBoard(currentBoard, boards[0]);
        CopyBoard(menuBoard, initialPosition);
        if (gameMode == IcsExamining && ics_type == ICS_FICS) {