summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-02-12 10:24:57 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-02-12 10:24:57 +0800
commit73ff68a955e2dff588c7ae42b98d82c88d6974cd (patch)
tree8b327b9807b4ad4dd9453009a9a30a7f1300a472
parent302a274608444f68789ad902f85b3d7204835120 (diff)
downloadpttbbs-73ff68a955e2dff588c7ae42b98d82c88d6974cd.tar
pttbbs-73ff68a955e2dff588c7ae42b98d82c88d6974cd.tar.gz
pttbbs-73ff68a955e2dff588c7ae42b98d82c88d6974cd.tar.bz2
pttbbs-73ff68a955e2dff588c7ae42b98d82c88d6974cd.tar.lz
pttbbs-73ff68a955e2dff588c7ae42b98d82c88d6974cd.tar.xz
pttbbs-73ff68a955e2dff588c7ae42b98d82c88d6974cd.tar.zst
pttbbs-73ff68a955e2dff588c7ae42b98d82c88d6974cd.zip
if the gamble is stopped, dont join
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1527 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-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);