summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/cal.c7
-rw-r--r--mbbsd/talk.c4
2 files changed, 6 insertions, 5 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';
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 643a3d86..ddedb827 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -1,4 +1,4 @@
-/* $Id: talk.c,v 1.25 2002/05/02 06:27:40 lwms Exp $ */
+/* $Id: talk.c,v 1.26 2002/05/02 06:41:46 lwms Exp $ */
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -2094,7 +2094,7 @@ static void pickup_user(void)
if (getdata(b_lines - 1, 0, "[銀行轉帳]:", genbuf, 7,
LCECHO)){
clrtoeol();
- if ((ch = atoi(genbuf)) <= 0)
+ if ((ch = atoi(genbuf)) <= 0 || ch == give_tax(ch) )
break;
reload_money();
if (ch > cuser.money)