From dbe4efa5777ce48d99018eff680fc279e8ccee06 Mon Sep 17 00:00:00 2001 From: piaip Date: Tue, 23 Jun 2009 14:35:18 +0000 Subject: * move money calibration from bbs.c to edit.c * fix: previous entropy limitation would half max post money git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4695 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/edit.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'mbbsd/edit.c') diff --git a/mbbsd/edit.c b/mbbsd/edit.c index db80fbad..c34a992e 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -44,6 +44,10 @@ #define EDIT_SIZE_LIMIT (32768*1024) #define EDIT_LINE_LIMIT (65530) // (1048576) +#ifndef POST_MONEY_RATIO +#define POST_MONEY_RATIO (0.5f) +#endif + #define ENTROPY_RATIO (0.25f) #define ENTROPY_MAX (MAX_POST_MONEY/ENTROPY_RATIO) @@ -3644,14 +3648,18 @@ vedit2(const char *fpath, int saveheader, int *islocal, char title[STRLEN], int (flags & EDITFLAG_UPLOAD) ? 1 : 0, (flags & EDITFLAG_ALLOWTITLE) ? 1 : 0, &entropy); - // money or entropy? - if (money > (entropy * ENTROPY_RATIO) && entropy >= 0) - money = (entropy * ENTROPY_RATIO) + 1; if (tmp != KEEP_EDITING) { currutmp->mode = mode0; currutmp->destuid = destuid0; exit_edit_buffer(); + + // adjust final money + money *= POST_MONEY_RATIO; + // money or entropy? + if (money > (entropy * ENTROPY_RATIO) && entropy >= 0) + money = (entropy * ENTROPY_RATIO) + 1; + if (!tmp) return money; else -- cgit v1.2.3