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
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* Known contributors to this file:
|
||||
* Steve McClure, 2000
|
||||
* Markus Armbruster, 2007-2008
|
||||
* Markus Armbruster, 2007-2013
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -49,8 +49,7 @@ caploss(struct sctstr *sp, natid coun, char *msg)
|
|||
struct natstr *natp;
|
||||
struct lonstr loan;
|
||||
struct comstr comm;
|
||||
long lose;
|
||||
long gain;
|
||||
int lose, gain;
|
||||
char *verb;
|
||||
int loan_num, comm_num;
|
||||
|
||||
|
@ -81,9 +80,9 @@ caploss(struct sctstr *sp, natid coun, char *msg)
|
|||
verb = sp->sct_own ? "sacked" : "obliterated";
|
||||
wu(0, coun, "* %s just %s your capital! *\n",
|
||||
cname(player->cnum), verb);
|
||||
wu(0, coun, "You lost $%ld and they gained $%ld\n", lose, gain);
|
||||
wu(0, coun, "You lost $%d and they gained $%d\n", lose, gain);
|
||||
wu(0, coun, "You need to use 'capital' to activate a new capital.\n");
|
||||
wu(0, 0, "%s just %s %s's capital and gained $%ld\n",
|
||||
wu(0, 0, "%s just %s %s's capital and gained $%d\n",
|
||||
cname(player->cnum), verb, cname(coun), gain);
|
||||
|
||||
if (opt_LOANS && sp->sct_own) {
|
||||
|
|
|
@ -67,7 +67,7 @@ disloan(int n, struct lonstr *loan)
|
|||
pr("\nLoan #%d from %s to", n, cname(loan->l_loner));
|
||||
pr(" %s\n", cname(loan->l_lonee));
|
||||
if (loan->l_status == LS_PROPOSED) {
|
||||
pr("(proposed) principal=$%ld interest rate=%d%%",
|
||||
pr("(proposed) principal=$%d interest rate=%d%%",
|
||||
loan->l_amtdue, loan->l_irate);
|
||||
pr(" duration(days)=%d\n", loan->l_ldur);
|
||||
if (loan->l_duedate < now) {
|
||||
|
@ -81,7 +81,7 @@ disloan(int n, struct lonstr *loan)
|
|||
return 1;
|
||||
}
|
||||
|
||||
pr("Amount paid to date $%ld\n", loan->l_amtpaid);
|
||||
pr("Amount paid to date $%d\n", loan->l_amtpaid);
|
||||
pr("Amount due (if paid now) $%.2f", loan_owed(loan, now));
|
||||
if (now <= loan->l_duedate) {
|
||||
pr(" (if paid on due date) $%.2f\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue