diff options
author | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-09 05:50:42 +0800 |
---|---|---|
committer | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-09 05:50:42 +0800 |
commit | e28a0fc596acffdfc640501707ba71d3ccd2e17d (patch) | |
tree | afc6c2f805753bb53f1f6634c4e574d199405e51 /mbbsd/chc.c | |
parent | a8d6240a1db56b86073d284ee5abf433e8d283d5 (diff) | |
download | pttbbs-e28a0fc596acffdfc640501707ba71d3ccd2e17d.tar pttbbs-e28a0fc596acffdfc640501707ba71d3ccd2e17d.tar.gz pttbbs-e28a0fc596acffdfc640501707ba71d3ccd2e17d.tar.bz2 pttbbs-e28a0fc596acffdfc640501707ba71d3ccd2e17d.tar.lz pttbbs-e28a0fc596acffdfc640501707ba71d3ccd2e17d.tar.xz pttbbs-e28a0fc596acffdfc640501707ba71d3ccd2e17d.tar.zst pttbbs-e28a0fc596acffdfc640501707ba71d3ccd2e17d.zip |
Fix r3015.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3017 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/chc.c')
-rw-r--r-- | mbbsd/chc.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/mbbsd/chc.c b/mbbsd/chc.c index 101079c1..4daa1c7a 100644 --- a/mbbsd/chc.c +++ b/mbbsd/chc.c @@ -37,7 +37,7 @@ typedef struct { } chc_tag_data_t; /* chess framework action functions */ -static void chc_init_user(const userec_t *userec, ChessUser *user); +static void chc_init_user(const userinfo_t *userec, ChessUser *user); static void chc_init_board(const ChessInfo* info, board_t board); static void chc_drawline(const ChessInfo* info, int line); static void chc_movecur(int r, int c); @@ -362,7 +362,7 @@ chc_drawline(const ChessInfo* info, int line) ANSI_COLOR(34) "%2d" ANSI_COLOR(37) "±Ñ " ANSI_COLOR(36) "%2d" ANSI_COLOR(37) "©M" ANSI_RESET, info->user2.userid, - info->user2.win, info->user2.lose - 1, info->user2.tie); + info->user2.win, info->user2.lose, info->user2.tie); } } } @@ -698,7 +698,7 @@ chcusr_put(userec_t* userec, const ChessUser* user) } static void -chc_init_user(const userec_t *userec, ChessUser *user) +chc_init_user(const userinfo_t *uinfo, ChessUser *user) { strlcpy(user->userid, userec->userid, sizeof(user->userid)); user->win = userec->chc_win; @@ -863,6 +863,15 @@ chc(int s, ChessGameMode mode) info->board = board; info->tag = &tag; + if (info->mode == CHESS_MODE_VERSUS) { + /* Assume that info->user1 is me. */ + info->user1.lose++; + count_chess_elo_rating(&info->user1, &info->user2, 0.0); + passwd_query(usernum, &cuser); + chcusr_put(&cuser, &info->user1); + passwd_update(usernum, &cuser); + } + if (mode == CHESS_MODE_WATCH) setutmpmode(CHESSWATCHING); else |