diff options
author | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-09-11 17:06:58 +0800 |
---|---|---|
committer | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-09-11 17:06:58 +0800 |
commit | 915be02b2a9538045ac94c4cac2fdfd49fd2a1e6 (patch) | |
tree | 84a4e6360baf964aac5e3e2443400a3a1847f32f /mbbsd/chess.c | |
parent | f1c53390c4817e5f9552588f298808764ef1bc65 (diff) | |
download | pttbbs-915be02b2a9538045ac94c4cac2fdfd49fd2a1e6.tar pttbbs-915be02b2a9538045ac94c4cac2fdfd49fd2a1e6.tar.gz pttbbs-915be02b2a9538045ac94c4cac2fdfd49fd2a1e6.tar.bz2 pttbbs-915be02b2a9538045ac94c4cac2fdfd49fd2a1e6.tar.lz pttbbs-915be02b2a9538045ac94c4cac2fdfd49fd2a1e6.tar.xz pttbbs-915be02b2a9538045ac94c4cac2fdfd49fd2a1e6.tar.zst pttbbs-915be02b2a9538045ac94c4cac2fdfd49fd2a1e6.zip |
GO chess replay implemented
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3155 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/chess.c')
-rw-r--r-- | mbbsd/chess.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/mbbsd/chess.c b/mbbsd/chess.c index 1c5b44d1..56124c42 100644 --- a/mbbsd/chess.c +++ b/mbbsd/chess.c @@ -655,10 +655,9 @@ ChessPlayFuncHis(ChessInfo* info) game_result = CHESS_RESULT_WIN; endturn = 1; } else if (result == CHESS_STEP_PASS) { - ChessStepType type = CHESS_STEP_PASS; strcpy(info->last_movestr, "µê¤â"); - info->pass[info->turn] = 1; + info->pass[(int) info->turn] = 1; endturn = 1; } else if (result == CHESS_STEP_TIE) { if (ChessAnswerRequest(info, "©M´Ñ")) { @@ -684,7 +683,7 @@ ChessPlayFuncHis(ChessInfo* info) game_result = CHESS_RESULT_CONTINUE; } endturn = 1; - info->pass[info->turn] = 0; + info->pass[(int) info->turn] = 0; ChessStepMade(info, 1); info->actions->drawstep(info, &info->step_tmp); } else if (result == CHESS_STEP_UNDO_ACC) { @@ -1255,9 +1254,13 @@ ChessReplayGame(const char* fname) info = ChessReplayMap[found].func(fp); fclose(fp); - screen_backup(&oldscreen); - ChessPlay(info); - screen_restore(&oldscreen); + if (info) { + screen_backup(&oldscreen); + ChessPlay(info); + screen_restore(&oldscreen); + + DeleteChessInfo(info); + } return 0; } |