diff options
author | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-20 12:11:10 +0800 |
---|---|---|
committer | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-20 12:11:10 +0800 |
commit | 6976aea4703c91fbfe7fd6c3a6a1094ae98e2002 (patch) | |
tree | a4304fb922243842eacfcb6cd7c3f0939e23d904 /mbbsd/chc.c | |
parent | ef982e5c13120616dbfb32552d74deba348c27a1 (diff) | |
download | pttbbs-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/chc.c')
-rw-r--r-- | mbbsd/chc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mbbsd/chc.c b/mbbsd/chc.c index f1339e14..45c2bb47 100644 --- a/mbbsd/chc.c +++ b/mbbsd/chc.c @@ -44,7 +44,7 @@ static void chc_movecur(int r, int c); static void chc_prepare_play(ChessInfo* info); static int chc_select(ChessInfo* info, rc_t scrloc, ChessGameResult* result); static void chc_prepare_step(ChessInfo* info, const void* step); -static int chc_movechess(board_t board, const drc_t* move); +static ChessGameResult chc_movechess(board_t board, const drc_t* move); static void chc_drawstep(ChessInfo* info, const drc_t* move); static void chc_gameend(ChessInfo* info, ChessGameResult result); static void chc_genlog(ChessInfo* info, FILE* fp, ChessGameResult result); @@ -105,7 +105,7 @@ static const ChessActions chc_actions = { &chc_prepare_play, &chc_select, &chc_prepare_step, - (int (*) (void*, const void*)) &chc_movechess, + (ChessGameResult (*) (void*, const void*)) &chc_movechess, (void (*)(ChessInfo*, const void*)) &chc_drawstep, &chc_gameend, &chc_genlog @@ -383,7 +383,7 @@ chc_prepare_step(ChessInfo* info, const void* step) &move->from, &move->to, info->last_movestr); } -static int +static ChessGameResult chc_movechess(board_t board, const drc_t* move) { int end = (CHE_P(board[move->to.r][move->to.c]) == KIND_K); @@ -391,7 +391,7 @@ chc_movechess(board_t board, const drc_t* move) board[move->to.r][move->to.c] = board[move->from.r][move->from.c]; board[move->from.r][move->from.c] = 0; - return end; + return end ? CHESS_RESULT_WIN : CHESS_RESULT_CONTINUE; } static void |