Code dealing with reserves mixes int and long pretty haphazardly.
Harmless, because practical reserves fit easily on any machine capable
of running the server. Clean up anyway.
int nat_timeused; /* number of seconds used today */
short nat_btu; /* bureaucratic time units */
short nat_access; /* The tick when BTUs were last updated */
- long nat_reserve; /* military reserves */
+ int nat_reserve; /* military reserves */
long nat_money; /* moola */
time_t nat_last_login; /* time of last login, 0 menas never */
time_t nat_last_logout; /* time of last logout, 0 means never */
}
if (mil) {
n = (mil - np->nat_reserve * money_res * etu) / (etu * money_mil);
- sprintf(in, "%d mil, %d res", n, (int)np->nat_reserve);
+ sprintf(in, "%d mil, %d res", n, np->nat_reserve);
pr("Military payroll\t\t%-32s%8d\n", in, -mil);
expenses -= mil;
}
}
pr("Total new civilians : %d\n", mil_demob);
if (*p == 'y')
- pr("Military reserve stands at %ld (up %d)\n",
+ pr("Military reserve stands at %d (up %d)\n",
natp->nat_reserve + reserves, reserves);
if (reserves > 0) {
natp->nat_reserve += reserves;
pr("Name <n>: %-20s\t", np->nat_cnam);
pr("Representative <r>: %-20s\n", np->nat_pnam);
pr("BTUs <b>: %3d\t\t\t", np->nat_btu);
- pr("Reserves <m>: %5ld\n", np->nat_reserve);
+ pr("Reserves <m>: %5d\n", np->nat_reserve);
pr("Capital <c>: %s\t\t",
xyas(np->nat_xcap, np->nat_ycap, player->cnum));
pr("Origin <o>: %3s\n",
break;
case 'm':
benefit(nat, np->nat_reserve < arg);
- pr("Military reserves changed from %ld to %d\n",
+ pr("Military reserves changed from %d to %d\n",
np->nat_reserve, arg);
wu(player->cnum, nat,
- "Military reserves changed from %ld to %d by divine intervention.\n",
+ "Military reserves changed from %d to %d by divine intervention.\n",
np->nat_reserve, arg);
np->nat_reserve = arg;
break;
int newmil;
int milwant;
int totalmil;
- long reserve;
+ int reserve;
char *p;
int quota;
char prompt[128];
}
}
pr("Total new enlistment : %d\n", totalmil);
- pr("Military reserves stand at %ld\n", reserve);
+ pr("Military reserves stand at %d\n", reserve);
if (totalmil) {
natp->nat_reserve -= totalmil;
putnat(natp);
}
}
pr(" The treasury has $%.2f", (double)natp->nat_money);
- pr(" Military reserves: %ld\n", natp->nat_reserve);
+ pr(" Military reserves: %d\n", natp->nat_reserve);
pr("Education..........%6.2f Happiness.......%6.2f\n",
natp->nat_level[NAT_ELEV], natp->nat_level[NAT_HLEV]);
pr("Technology.........%6.2f Research........%6.2f\n",
{"timeused", fldoff(nat_timeused), NSC_INT, 0, NULL, EF_BAD, 0},
{"btu", fldoff(nat_btu), NSC_SHORT, 0, NULL, EF_BAD, 0},
{"access", fldoff(nat_access), NSC_SHORT, 0, NULL, EF_BAD, 0},
- {"milreserve", fldoff(nat_reserve), NSC_LONG, 0, NULL, EF_BAD, 0},
+ {"milreserve", fldoff(nat_reserve), NSC_INT, 0, NULL, EF_BAD, 0},
{"money", fldoff(nat_money), NSC_LONG, 0, NULL, EF_BAD, 0},
{"login", fldoff(nat_last_login), NSC_TIME, 0, NULL, EF_BAD, 0},
{"logout", fldoff(nat_last_logout), NSC_TIME, 0, NULL, EF_BAD, 0},
"timeused" 8 1 0 -1
"btu" 6 1 0 -1
"access" 6 1 0 -1
-"milreserve" 1 1 0 -1
+"milreserve" 8 1 0 -1
"money" 1 1 0 -1
"login" 12 1 0 -1
"logout" 12 1 0 -1
"timeused" 8 0 0 -1
"btu" 6 0 0 -1
"access" 6 0 0 -1
-"milreserve" 1 0 0 -1
+"milreserve" 8 0 0 -1
"money" 1 0 0 -1
"login" 12 0 0 -1
"logout" 12 0 0 -1
"timeused" 8 0 0 -1
"btu" 6 0 0 -1
"access" 6 0 0 -1
-"milreserve" 1 0 0 -1
+"milreserve" 8 0 0 -1
"money" 1 0 0 -1
"login" 12 0 0 -1
"logout" 12 0 0 -1