From 61f4d7014333e7901e090228fa3009877ba4802c Mon Sep 17 00:00:00 2001 From: scw Date: Fri, 1 Jun 2007 13:47:00 +0000 Subject: Fix chess undo incorrectly set info->turn git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3525 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/chess.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mbbsd/chess.c') diff --git a/mbbsd/chess.c b/mbbsd/chess.c index ca99bfaf..d1ad3ad0 100644 --- a/mbbsd/chess.c +++ b/mbbsd/chess.c @@ -387,9 +387,12 @@ ChessReplayUntil(ChessInfo* info, int n) /* spcial for last one to maintian information correct */ step = ChessHistoryRetrieve(info, info->current_step); - info->turn = info->current_step++ & 1; + + if (info->mode == CHESS_MODE_WATCH || info->mode == CHESS_MODE_REPLAY) + info->turn = info->current_step & 1; info->actions->prepare_step(info, step); info->actions->apply_step(info->board, step); + info->current_step++; } static int @@ -779,7 +782,6 @@ ChessPlayFuncWatch(ChessInfo* info) /* at head but redo-ed */ info->actions->init_board(info->board); info->current_step = 0; - info->turn = 1; ChessReplayUntil(info, info->history.used - 1); ChessRedraw(info); } -- cgit v1.2.3