summaryrefslogtreecommitdiffstats
path: root/mbbsd/chess.c
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-06-01 21:47:00 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-06-01 21:47:00 +0800
commit61f4d7014333e7901e090228fa3009877ba4802c (patch)
tree9a3b230d40247fad6e1f7556c3f021fc14d2b9f2 /mbbsd/chess.c
parent15a7b86bf116a005e7c0f35b03a7a5be034c5479 (diff)
downloadpttbbs-61f4d7014333e7901e090228fa3009877ba4802c.tar
pttbbs-61f4d7014333e7901e090228fa3009877ba4802c.tar.gz
pttbbs-61f4d7014333e7901e090228fa3009877ba4802c.tar.bz2
pttbbs-61f4d7014333e7901e090228fa3009877ba4802c.tar.lz
pttbbs-61f4d7014333e7901e090228fa3009877ba4802c.tar.xz
pttbbs-61f4d7014333e7901e090228fa3009877ba4802c.tar.zst
pttbbs-61f4d7014333e7901e090228fa3009877ba4802c.zip
Fix chess undo incorrectly set info->turn
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3525 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/chess.c')
-rw-r--r--mbbsd/chess.c6
1 files changed, 4 insertions, 2 deletions
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);
}