[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] Bug: GTP boardsize does not clear move stack
From: |
Daniel Bump |
Subject: |
Re: [gnugo-devel] Bug: GTP boardsize does not clear move stack |
Date: |
Tue, 6 Nov 2001 09:13:23 -0800 |
> Hello,
>
> I found a small bug when using GnuGo 3.1.12 in GTP mode.
> When I start a new game with the "boardsize" command,
> the index to the move stack is not reset.
>
> This causes "undo" commands in the new game to fail,
> since "undo" restores the position from the move stack
> and the move stack can contain illegal sequences of moves
> from the new and the old game.
>
> - Markus
Presumably the following patch should fix that. I haven't
tested it but I can't imagine that it will break anything.
Setting the board size should reset the engine.
Dan
RCS file: /cvsroot/gnugo/gnugo/interface/play_gtp.c,v
retrieving revision 1.40
diff -u -r1.40 play_gtp.c
--- interface/play_gtp.c 2001/11/06 16:36:51 1.40
+++ interface/play_gtp.c 2001/11/06 17:14:10
@@ -320,6 +320,8 @@
board_size = boardsize;
clear_board();
gtp_internal_set_boardsize(boardsize);
+ reset_engine();
+ move_stack_pointer = 0;
store_position(&starting_position);
return gtp_success(id, "");
}