From 73ff68a955e2dff588c7ae42b98d82c88d6974cd Mon Sep 17 00:00:00 2001 From: victor Date: Thu, 12 Feb 2004 02:24:57 +0000 Subject: if the gamble is stopped, dont join git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1527 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 10 +++++++--- mbbsd/gamble.c | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index d7826d5b..160e499c 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1253,13 +1253,13 @@ b_man() } #ifndef NO_GAMBLE -void +static int stop_gamble() { boardheader_t *bp = getbcache(currbid); char fn_ticket[128], fn_ticket_end[128]; if (!bp->endgamble || bp->endgamble > now) - return; + return 1; setbfile(fn_ticket, currboard, FN_TICKET); setbfile(fn_ticket_end, currboard, FN_TICKET_END); @@ -1269,13 +1269,17 @@ stop_gamble() bp->endgamble = 0; substitute_record(fn_board, bp, sizeof(boardheader_t), currbid); } + return 0; } static int join_gamble(int ent, fileheader_t * fhdr, char *direct) { if (!HAS_PERM(PERM_LOGINOK)) return DONOTHING; - stop_gamble(); + if (stop_gamble()) { + vmsg("目前未舉辦賭盤或賭盤已開獎"); + return DONOTHING; + } ticket(currbid); return FULLUPDATE; } diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c index c19f1e5a..33e67bb8 100644 --- a/mbbsd/gamble.c +++ b/mbbsd/gamble.c @@ -226,7 +226,7 @@ openticket(int bid) #endif - bet -= 1; /* 轉成矩陣的index */ + bet--; /* 轉成矩陣的index */ total = load_ticket_record(path, ticket); setbfile(buf, bh->brdname, FN_TICKET_END); -- cgit v1.2.3