summaryrefslogtreecommitdiffstats
path: root/mbbsd/chess.c
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-20 12:11:10 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-20 12:11:10 +0800
commit6976aea4703c91fbfe7fd6c3a6a1094ae98e2002 (patch)
treea4304fb922243842eacfcb6cd7c3f0939e23d904 /mbbsd/chess.c
parentef982e5c13120616dbfb32552d74deba348c27a1 (diff)
downloadpttbbs-6976aea4703c91fbfe7fd6c3a6a1094ae98e2002.tar
pttbbs-6976aea4703c91fbfe7fd6c3a6a1094ae98e2002.tar.gz
pttbbs-6976aea4703c91fbfe7fd6c3a6a1094ae98e2002.tar.bz2
pttbbs-6976aea4703c91fbfe7fd6c3a6a1094ae98e2002.tar.lz
pttbbs-6976aea4703c91fbfe7fd6c3a6a1094ae98e2002.tar.xz
pttbbs-6976aea4703c91fbfe7fd6c3a6a1094ae98e2002.tar.zst
pttbbs-6976aea4703c91fbfe7fd6c3a6a1094ae98e2002.zip
Wrong winner on rule-violating step.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3066 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
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);