summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/chc.c6
-rw-r--r--mbbsd/chess.c23
2 files changed, 20 insertions, 9 deletions
diff --git a/mbbsd/chc.c b/mbbsd/chc.c
index 6f53bc8b..40b190fa 100644
--- a/mbbsd/chc.c
+++ b/mbbsd/chc.c
@@ -438,8 +438,10 @@ chc_genlog(ChessInfo* info, FILE* fp, ChessGameResult result)
chc_init_board(board);
for (i = 0; i < nStep; ++i) {
const drc_t *move = (const drc_t*) ChessHistoryRetrieve(info, i);
- chc_log_step(fp, board, move);
- chc_movechess(board, move);
+ if (move->type == CHESS_STEP_NORMAL) {
+ chc_log_step(fp, board, move);
+ chc_movechess(board, move);
+ }
}
if (result == CHESS_RESULT_TIE)
diff --git a/mbbsd/chess.c b/mbbsd/chess.c
index d6b1a292..7453a78f 100644
--- a/mbbsd/chess.c
+++ b/mbbsd/chess.c
@@ -343,13 +343,22 @@ ChessPlayFuncMy(ChessInfo* info)
break;
case 'p':
- info->ipass = 1;
- ChessMessageSend(info, CHESS_STEP_PASS);
- strlcpy(info->warnmsg,
- ANSI_COLOR(1;33) "要求和棋!" ANSI_RESET,
- sizeof(info->warnmsg));
- info->actions->drawline(info, CHESS_DRAWING_WARN_ROW);
- bell();
+ {
+ char buf[4];
+ getdata(b_lines, 0, "是否真的要和棋?(y/N)",
+ buf, sizeof(buf), DOECHO);
+ ChessDrawHelpLine(info);
+
+ if (buf[0] == 'y' || buf[1] == 'Y') {
+ info->ipass = 1;
+ ChessMessageSend(info, CHESS_STEP_PASS);
+ strlcpy(info->warnmsg,
+ ANSI_COLOR(1;33) "要求和棋!" ANSI_RESET,
+ sizeof(info->warnmsg));
+ info->actions->drawline(info, CHESS_DRAWING_WARN_ROW);
+ bell();
+ }
+ }
break;
case '\r':