diff options
Diffstat (limited to 'mbbsd/ch_gomo.c')
-rw-r--r-- | mbbsd/ch_gomo.c | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/mbbsd/ch_gomo.c b/mbbsd/ch_gomo.c index 0bffe04a..fb1a4182 100644 --- a/mbbsd/ch_gomo.c +++ b/mbbsd/ch_gomo.c @@ -230,14 +230,6 @@ gomo_move_warn(int style, char buf[]) return NULL; } -static void -gomoku_usr_put(userec_t* userec, const ChessUser* user) -{ - userec->five_win = user->win; - userec->five_lose = user->lose; - userec->five_tie = user->tie; -} - static char* gomo_getstep(const gomo_step_t* step, char buf[]) { @@ -395,24 +387,11 @@ static void gomo_gameend(ChessInfo* info, ChessGameResult result) { if (info->mode == CHESS_MODE_VERSUS) { - ChessUser* const user1 = &info->user1; - /* ChessUser* const user2 = &info->user2; */ - - user1->lose--; - if (result == CHESS_RESULT_WIN) { - user1->win++; - currutmp->five_win++; - } else if (result == CHESS_RESULT_LOST) { - user1->lose++; - currutmp->five_lose++; - } else { - user1->tie++; - currutmp->five_tie++; - } - gomoku_usr_put(cuser_ref, user1); + // lost was already initialized + if (result != CHESS_RESULT_LOST) + pwcuChessResult(SIG_GOMO, result); - passwd_sync_update(usernum, cuser_ref); } else if (info->mode == CHESS_MODE_REPLAY) { free(info->board); free(info->tag); @@ -535,9 +514,7 @@ gomoku(int s, ChessGameMode mode) if (info->mode == CHESS_MODE_VERSUS) { /* Assume that info->user1 is me. */ info->user1.lose++; - passwd_sync_query(usernum, cuser_ref); - gomoku_usr_put(cuser_ref, &info->user1); - passwd_sync_update(usernum, cuser_ref); + pwcuChessResult(SIG_GOMO, CHESS_RESULT_LOST); } if (mode == CHESS_MODE_WATCH) |