Fix taking back of moves
authorH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 10 Apr 2018 16:07:23 +0000 (18:07 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 10 Apr 2018 16:16:42 +0000 (18:16 +0200)
The loop over game history to remake the moves upto the desired position
was incrementing moveNr, but the RootMakeMove() it called already did that
too. With as a result that only white moves were replayed.

dropper.c

index 3730022..6f12051 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -1718,7 +1718,7 @@ TakeBack (int n)
   int last;
   stm = Setup(NULL); // uses FEN saved during previous Setup
   last = moveNr - n; if(last < 0) last = 0;
-  for(moveNr=0; moveNr<last; moveNr++) RootMakeMove(gameMove[moveNr]);
+  for(moveNr=0; moveNr<last; ) RootMakeMove(gameMove[moveNr]);
 }
 
 void PrintResult(int stm, int score)