summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/bbs.c10
-rw-r--r--mbbsd/gamble.c2
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);