(do_conv, enli, explore, move, shoo, s_commod): sct_mobil was changed
from u_char to short in 3.0.0, but many assignments still cast to u_char. Remove casts.
This commit is contained in:
parent
5c423d1e42
commit
aebcc536e4
6 changed files with 14 additions and 18 deletions
|
@ -159,7 +159,7 @@ do_conv(struct nstr_sect nstr, int uwtoconvert, int for_real)
|
||||||
mob = roundavg(mob * 0.2);
|
mob = roundavg(mob * 0.2);
|
||||||
if (mob > sect.sct_mobil)
|
if (mob > sect.sct_mobil)
|
||||||
mob = sect.sct_mobil;
|
mob = sect.sct_mobil;
|
||||||
sect.sct_mobil -= (u_char)mob;
|
sect.sct_mobil -= mob;
|
||||||
pr("%3d conquered civilians converted in %s (%d)\n",
|
pr("%3d conquered civilians converted in %s (%d)\n",
|
||||||
newuw, xyas(sect.sct_x, sect.sct_y, player->cnum), uw + newuw);
|
newuw, xyas(sect.sct_x, sect.sct_y, player->cnum), uw + newuw);
|
||||||
if (civ == 0) {
|
if (civ == 0) {
|
||||||
|
|
|
@ -117,10 +117,8 @@ enli(void)
|
||||||
sect.sct_item[I_CIVIL] = civ - newmil;
|
sect.sct_item[I_CIVIL] = civ - newmil;
|
||||||
pr("%3d enlisted in %s (%d)\n", newmil,
|
pr("%3d enlisted in %s (%d)\n", newmil,
|
||||||
xyas(sect.sct_x, sect.sct_y, player->cnum), mil + newmil);
|
xyas(sect.sct_x, sect.sct_y, player->cnum), mil + newmil);
|
||||||
if (sect.sct_mobil > 0) {
|
if (sect.sct_mobil > 0)
|
||||||
sect.sct_mobil = (u_char)((float)sect.sct_mobil *
|
sect.sct_mobil *= 1.0 - (double)newmil / (double)civ;
|
||||||
(1.0 - (float)newmil / (float)civ));
|
|
||||||
}
|
|
||||||
putsect(§);
|
putsect(§);
|
||||||
if (totalmil >= 10000) {
|
if (totalmil >= 10000) {
|
||||||
pr("Rioting in induction center interrupts enlistment\n");
|
pr("Rioting in induction center interrupts enlistment\n");
|
||||||
|
|
|
@ -95,7 +95,7 @@ explore(void)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
}
|
}
|
||||||
own = sect.sct_own;
|
own = sect.sct_own;
|
||||||
mob = (int)sect.sct_mobil;
|
mob = sect.sct_mobil;
|
||||||
if (vtype == I_CIVIL && sect.sct_oldown != own) {
|
if (vtype == I_CIVIL && sect.sct_oldown != own) {
|
||||||
pr("You can't explore with conquered populace!\n");
|
pr("You can't explore with conquered populace!\n");
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
|
@ -172,14 +172,14 @@ explore(void)
|
||||||
if (mcost < 0) {
|
if (mcost < 0) {
|
||||||
pr("\nExplore aborted");
|
pr("\nExplore aborted");
|
||||||
getsect(start.sct_x, start.sct_y, §);
|
getsect(start.sct_x, start.sct_y, §);
|
||||||
sect.sct_mobil = (u_char)mob;
|
sect.sct_mobil = mob;
|
||||||
} else {
|
} else {
|
||||||
/* Charge mobility */
|
/* Charge mobility */
|
||||||
getsect(sect.sct_x, sect.sct_y, §);
|
getsect(sect.sct_x, sect.sct_y, §);
|
||||||
n = sect.sct_mobil - mcost;
|
n = sect.sct_mobil - mcost;
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
n = 0;
|
n = 0;
|
||||||
sect.sct_mobil = (u_char)n;
|
sect.sct_mobil = n;
|
||||||
pr(", %d mob left in %s", sect.sct_mobil,
|
pr(", %d mob left in %s", sect.sct_mobil,
|
||||||
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
||||||
putsect(§);
|
putsect(§);
|
||||||
|
|
|
@ -107,7 +107,7 @@ move(void)
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
own = sect.sct_own;
|
own = sect.sct_own;
|
||||||
mob = (int)sect.sct_mobil;
|
mob = sect.sct_mobil;
|
||||||
if (!istest && vtype == I_CIVIL && sect.sct_oldown != own) {
|
if (!istest && vtype == I_CIVIL && sect.sct_oldown != own) {
|
||||||
pr("You can't move conquered populace!\n");
|
pr("You can't move conquered populace!\n");
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
|
@ -217,7 +217,7 @@ move(void)
|
||||||
if (mcost < 0) {
|
if (mcost < 0) {
|
||||||
pr("Move aborted\n");
|
pr("Move aborted\n");
|
||||||
getsect(x, y, §);
|
getsect(x, y, §);
|
||||||
sect.sct_mobil = (u_char)mob;
|
sect.sct_mobil = mob;
|
||||||
left = mob;
|
left = mob;
|
||||||
} else {
|
} else {
|
||||||
if (!istest) {
|
if (!istest) {
|
||||||
|
@ -231,7 +231,7 @@ move(void)
|
||||||
mob = 0;
|
mob = 0;
|
||||||
} else
|
} else
|
||||||
mob -= mcost;
|
mob -= mcost;
|
||||||
start.sct_mobil = (u_char)mob;
|
start.sct_mobil = mob;
|
||||||
left = start.sct_mobil;
|
left = start.sct_mobil;
|
||||||
putsect(&start);
|
putsect(&start);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,6 @@ shoo(void)
|
||||||
struct nstr_sect nstr;
|
struct nstr_sect nstr;
|
||||||
struct nstr_item ni;
|
struct nstr_item ni;
|
||||||
int nshot;
|
int nshot;
|
||||||
int mob_cost;
|
|
||||||
double m;
|
double m;
|
||||||
i_type item;
|
i_type item;
|
||||||
struct ichrstr *ip;
|
struct ichrstr *ip;
|
||||||
|
@ -109,8 +108,7 @@ shoo(void)
|
||||||
m = 0;
|
m = 0;
|
||||||
if (m > sect.sct_mobil)
|
if (m > sect.sct_mobil)
|
||||||
m = sect.sct_mobil;
|
m = sect.sct_mobil;
|
||||||
mob_cost = roundavg(m);
|
sect.sct_mobil -= roundavg(m);
|
||||||
sect.sct_mobil -= (u_char)mob_cost;
|
|
||||||
sect.sct_item[item] -= nshot;
|
sect.sct_item[item] -= nshot;
|
||||||
pr("BANG!! (thump) %d %s shot in %s!\n",
|
pr("BANG!! (thump) %d %s shot in %s!\n",
|
||||||
nshot, ip->i_name, xyas(sect.sct_x, sect.sct_y, player->cnum));
|
nshot, ip->i_name, xyas(sect.sct_x, sect.sct_y, player->cnum));
|
||||||
|
|
|
@ -236,7 +236,7 @@ s_commod(int own, int x, int y, i_type type, int total_wanted,
|
||||||
n = 0;
|
n = 0;
|
||||||
if (n > sect.sct_mobil)
|
if (n > sect.sct_mobil)
|
||||||
n = sect.sct_mobil;
|
n = sect.sct_mobil;
|
||||||
sect.sct_mobil -= (u_char)n;
|
sect.sct_mobil -= n;
|
||||||
|
|
||||||
if (actually_doit)
|
if (actually_doit)
|
||||||
putsect(§);
|
putsect(§);
|
||||||
|
@ -254,7 +254,7 @@ s_commod(int own, int x, int y, i_type type, int total_wanted,
|
||||||
n = 0;
|
n = 0;
|
||||||
if (n > sect.sct_mobil)
|
if (n > sect.sct_mobil)
|
||||||
n = sect.sct_mobil;
|
n = sect.sct_mobil;
|
||||||
sect.sct_mobil -= (u_char)n;
|
sect.sct_mobil -= n;
|
||||||
|
|
||||||
if (actually_doit)
|
if (actually_doit)
|
||||||
putsect(§);
|
putsect(§);
|
||||||
|
@ -308,7 +308,7 @@ s_commod(int own, int x, int y, i_type type, int total_wanted,
|
||||||
n = 0;
|
n = 0;
|
||||||
if (n > sect.sct_mobil)
|
if (n > sect.sct_mobil)
|
||||||
n = sect.sct_mobil;
|
n = sect.sct_mobil;
|
||||||
sect.sct_mobil -= (u_char)n;
|
sect.sct_mobil -= n;
|
||||||
if (actually_doit) {
|
if (actually_doit) {
|
||||||
putship(ship.shp_uid, &ship);
|
putship(ship.shp_uid, &ship);
|
||||||
putsect(§);
|
putsect(§);
|
||||||
|
@ -325,7 +325,7 @@ s_commod(int own, int x, int y, i_type type, int total_wanted,
|
||||||
n = 0;
|
n = 0;
|
||||||
if (n > sect.sct_mobil)
|
if (n > sect.sct_mobil)
|
||||||
n = sect.sct_mobil;
|
n = sect.sct_mobil;
|
||||||
sect.sct_mobil -= (u_char)n;
|
sect.sct_mobil -= n;
|
||||||
|
|
||||||
if (actually_doit) {
|
if (actually_doit) {
|
||||||
putship(ship.shp_uid, &ship);
|
putship(ship.shp_uid, &ship);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue