diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-23 22:35:18 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-23 22:35:18 +0800 |
commit | dbe4efa5777ce48d99018eff680fc279e8ccee06 (patch) | |
tree | 39afedca65a06c60dc6774e47088c11eaa14a9c2 /mbbsd/edit.c | |
parent | 810217595d84a37ab442dc498d1ca8828ad20f21 (diff) | |
download | pttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.tar pttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.tar.gz pttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.tar.bz2 pttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.tar.lz pttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.tar.xz pttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.tar.zst pttbbs-dbe4efa5777ce48d99018eff680fc279e8ccee06.zip |
* 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
Diffstat (limited to 'mbbsd/edit.c')
-rw-r--r-- | mbbsd/edit.c | 14 |
1 files changed, 11 insertions, 3 deletions
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 |