diff options
author | lwms <lwms@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-05-02 14:41:46 +0800 |
---|---|---|
committer | lwms <lwms@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-05-02 14:41:46 +0800 |
commit | 92cbeda4973bec116ba5f74d524e40a13313f42f (patch) | |
tree | f1f76b52200e90fe38c80406e57c9dc4c9770829 /mbbsd/cal.c | |
parent | 2a15c1580f415b045fe126ccad26b09b4945d090 (diff) | |
download | pttbbs-92cbeda4973bec116ba5f74d524e40a13313f42f.tar pttbbs-92cbeda4973bec116ba5f74d524e40a13313f42f.tar.gz pttbbs-92cbeda4973bec116ba5f74d524e40a13313f42f.tar.bz2 pttbbs-92cbeda4973bec116ba5f74d524e40a13313f42f.tar.lz pttbbs-92cbeda4973bec116ba5f74d524e40a13313f42f.tar.xz pttbbs-92cbeda4973bec116ba5f74d524e40a13313f42f.tar.zst pttbbs-92cbeda4973bec116ba5f74d524e40a13313f42f.zip |
*** empty log message ***
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@142 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/cal.c')
-rw-r--r-- | mbbsd/cal.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mbbsd/cal.c b/mbbsd/cal.c index 6319ca50..c3d2303f 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -1,4 +1,4 @@ -/* $Id: cal.c,v 1.5 2002/05/02 06:30:22 lwms Exp $ */ +/* $Id: cal.c,v 1.6 2002/05/02 06:41:46 lwms Exp $ */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -369,7 +369,7 @@ void mail_redenvelop(char* from, char* to, int money, char mode){ int give_tax(int money) { int tax = 0, tax_rate; - static int tax_bound[] = { 1000000, 100000, 10000, 1000 }; + static int tax_bound[] = { 1000000, 100000, 10000, 1000}; for( tax_rate = 0; tax_rate <= 3; tax_rate++ ) if ( money >= tax_bound[tax_rate] ) break; tax = money * ( 0.5 - tax_rate/10.0 ); @@ -390,10 +390,11 @@ int p_give() { reload_money(); if(money > 0 && cuser.money >= money ) { tax = give_tax(money); + if ( money - tax <= 0 ) return 0; /* 繳完稅就沒錢給了 */ deumoney(searchuser(id), money - tax); demoney(-money); now = time(NULL); - sprintf(genbuf,"%s\t給%s\t%d\t%s", cuser.userid, id, money, + sprintf(genbuf,"%s\t給%s\t%d\t%s", cuser.userid, id, money - tax, ctime(&now)); log_file(FN_MONEY, genbuf); genbuf[0] = 'n'; |