summaryrefslogtreecommitdiffstats
path: root/mbbsd/chess.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/chess.c')
-rw-r--r--mbbsd/chess.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/mbbsd/chess.c b/mbbsd/chess.c
index 226feadf..55199d9c 100644
--- a/mbbsd/chess.c
+++ b/mbbsd/chess.c
@@ -561,8 +561,18 @@ ChessPlayFuncHis(ChessInfo* info)
ChessDrawLine(info, CHESS_DRAWING_WARN_ROW);
} else if (result == CHESS_STEP_NORMAL) {
info->actions->prepare_step(info, &info->step_tmp);
- if (info->actions->apply_step(info->board, &info->step_tmp))
- game_result = CHESS_RESULT_LOST;
+ switch (info->actions->apply_step(info->board, &info->step_tmp)) {
+ case CHESS_RESULT_LOST:
+ game_result = CHESS_RESULT_WIN;
+ break;
+
+ case CHESS_RESULT_WIN:
+ game_result = CHESS_RESULT_LOST;
+ break;
+
+ default:
+ game_result = CHESS_RESULT_CONTINUE;
+ }
endturn = 1;
info->hepass = 0;
ChessStepMade(info, 1);