Use int instead of long for money
Code dealing with money mixes int and long pretty haphazardly. Harmless, because practical amounts of money fit into int on any machine capable of running the server. Clean up anyway.
This commit is contained in:
parent
5ed02791f5
commit
5f46ced826
24 changed files with 73 additions and 73 deletions
|
@ -46,7 +46,7 @@ repa(void)
|
|||
struct natstr *loaner;
|
||||
int loan_num;
|
||||
int payment;
|
||||
long newdue;
|
||||
int newdue;
|
||||
char *cp;
|
||||
time_t now;
|
||||
char buf[1024];
|
||||
|
@ -75,13 +75,13 @@ repa(void)
|
|||
if (payment <= 0)
|
||||
return RET_SYN;
|
||||
|
||||
newdue = (long)ceil(loan_owed(&loan, time(&now)) - payment);
|
||||
newdue = (int)ceil(loan_owed(&loan, time(&now)) - payment);
|
||||
if (newdue < 0) {
|
||||
pr("You don't owe that much.\n");
|
||||
return RET_FAIL;
|
||||
}
|
||||
if (natp->nat_money < payment) {
|
||||
pr("You only have $%ld.\n", natp->nat_money);
|
||||
pr("You only have $%d.\n", natp->nat_money);
|
||||
return RET_FAIL;
|
||||
}
|
||||
player->dolcost += payment;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue