From c88f909fd3eb9111e3be6f01826c945e3e75d769 Mon Sep 17 00:00:00 2001 From: victor Date: Wed, 29 Oct 2003 00:56:19 +0000 Subject: fix assess bug git-svn-id: http://opensvn.csie.org/pttbbs/trunk@1273 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/assess.c | 13 ++++++------- pttbbs/mbbsd/bbs.c | 11 +++++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/pttbbs/mbbsd/assess.c b/pttbbs/mbbsd/assess.c index 6797f64d..dcae8c4e 100644 --- a/pttbbs/mbbsd/assess.c +++ b/pttbbs/mbbsd/assess.c @@ -5,7 +5,7 @@ /* do (*num) + n, n is integer. */ inline static void inc(unsigned char *num, int n) { - if (n >= 0 && SALE_MAXVALUE - *num < n) + if (n >= 0 && SALE_MAXVALUE - *num <= n) (*num) = SALE_MAXVALUE; else if (n < 0 && *num < -n) (*num) = 0; @@ -24,12 +24,11 @@ void inc_badpost(int uid, int num) { passwd_query(uid, &xuser); inc(&xuser.badpost, num); - if(!(xuser.badpost % 10)) - { - post_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張"); - mail_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張"); - xuser.userlevel |= PERM_VIOLATELAW; - } + if (!(xuser.badpost % 10)) { + post_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張"); + mail_violatelaw(xuser.userid, "Ptt 系統警察", "劣文累計十篇", "罰單一張"); + xuser.userlevel |= PERM_VIOLATELAW; + } passwd_update(uid, &xuser); } diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c index f599e735..6ebbe75c 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -1613,11 +1613,10 @@ mark_post(int ent, fileheader_t * fhdr, char *direct) #ifdef ASSESS if (!(fhdr->filemode & FILE_BID)){ - if (fhdr->filemode & FILE_MARKED) - { - if(!(currbrdattr&BRD_BAD)) - inc_goodpost(searchuser(fhdr->owner), fhdr->recommend / 10); - } + if (fhdr->filemode & FILE_MARKED) { + if(!(currbrdattr&BRD_BAD)) + inc_goodpost(searchuser(fhdr->owner), fhdr->recommend / 10); + } else inc_goodpost(searchuser(fhdr->owner), -1 * (fhdr->recommend / 10)); } @@ -1750,7 +1749,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct) cancelpost(fhdr, not_owned, newpath); #ifdef ASSESS - if (not_owned) + if (not_owned && currmode & MODE_DIGEST && is_BM(cuser.userid)) { getdata(1, 40, "惡劣文章?(y/N)", genbuf, 3, LCECHO); if(genbuf[0]=='y') -- cgit v1.2.3