Clean up dead stores
Does not change optimized code (gcc -O). Spotted by the Clang Static Analyzer.
This commit is contained in:
parent
3650587dab
commit
b8f5eaff0b
25 changed files with 66 additions and 116 deletions
|
@ -520,7 +520,6 @@ ship_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
dam = 0;
|
|
||||||
if (nuk_on_plane(&plp->plane) >= 0)
|
if (nuk_on_plane(&plp->plane) >= 0)
|
||||||
hitchance = 100;
|
hitchance = 100;
|
||||||
else {
|
else {
|
||||||
|
@ -624,7 +623,6 @@ plane_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||||
continue;
|
continue;
|
||||||
if (changed_plane_aborts(plp))
|
if (changed_plane_aborts(plp))
|
||||||
continue;
|
continue;
|
||||||
dam = 0;
|
|
||||||
if (nuk_on_plane(&plp->plane) >= 0)
|
if (nuk_on_plane(&plp->plane) >= 0)
|
||||||
hitchance = 100;
|
hitchance = 100;
|
||||||
else {
|
else {
|
||||||
|
@ -735,7 +733,6 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
dam = 0;
|
|
||||||
if (nuk_on_plane(&plp->plane) >= 0)
|
if (nuk_on_plane(&plp->plane) >= 0)
|
||||||
hitchance = 100;
|
hitchance = 100;
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -51,7 +51,6 @@ comm(void)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
prdate();
|
prdate();
|
||||||
(void)strcpy(dirstr, ". $");
|
(void)strcpy(dirstr, ". $");
|
||||||
n = 1;
|
|
||||||
for (n = 1; n <= 6; n++)
|
for (n = 1; n <= 6; n++)
|
||||||
dirstr[n] = dirch[n];
|
dirstr[n] = dirch[n];
|
||||||
nsect = 0;
|
nsect = 0;
|
||||||
|
|
|
@ -49,7 +49,6 @@ cuto(void)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
prdate();
|
prdate();
|
||||||
(void)strcpy(dirstr, ". $");
|
(void)strcpy(dirstr, ". $");
|
||||||
n = 1;
|
|
||||||
for (n = 1; n <= 6; n++)
|
for (n = 1; n <= 6; n++)
|
||||||
dirstr[n] = dirch[n];
|
dirstr[n] = dirch[n];
|
||||||
nsect = 0;
|
nsect = 0;
|
||||||
|
|
|
@ -54,7 +54,6 @@ dump(void)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
prdate();
|
prdate();
|
||||||
(void)strcpy(dirstr, ". $");
|
(void)strcpy(dirstr, ". $");
|
||||||
n = 1;
|
|
||||||
for (n = 1; n <= 6; n++)
|
for (n = 1; n <= 6; n++)
|
||||||
dirstr[n] = dirch[n];
|
dirstr[n] = dirch[n];
|
||||||
nsect = 0;
|
nsect = 0;
|
||||||
|
|
|
@ -105,7 +105,7 @@ head(void)
|
||||||
for (n = 0; n < 5; n++) {
|
for (n = 0; n < 5; n++) {
|
||||||
if ((scoop = head_findscoop(hist, maxcnum, &actor, &victim)) < 10)
|
if ((scoop = head_findscoop(hist, maxcnum, &actor, &victim)) < 10)
|
||||||
break;
|
break;
|
||||||
severity = head_printscoop(hist, actor, victim);
|
head_printscoop(hist, actor, victim);
|
||||||
hp = &hist[actor][victim];
|
hp = &hist[actor][victim];
|
||||||
severity = hp->h_recent - hp->h_past;
|
severity = hp->h_recent - hp->h_past;
|
||||||
if (severity <= -scoop / 2 || severity >= scoop / 2) {
|
if (severity <= -scoop / 2 || severity >= scoop / 2) {
|
||||||
|
|
|
@ -72,7 +72,6 @@ multifire(void)
|
||||||
coord fy;
|
coord fy;
|
||||||
coord x;
|
coord x;
|
||||||
coord y;
|
coord y;
|
||||||
int mil;
|
|
||||||
int dam;
|
int dam;
|
||||||
int totaldefdam = 0;
|
int totaldefdam = 0;
|
||||||
int vshipno;
|
int vshipno;
|
||||||
|
@ -265,7 +264,7 @@ multifire(void)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((mil = fship.shp_item[I_MILIT]) < 1) {
|
if (fship.shp_item[I_MILIT] < 1) {
|
||||||
pr("Not enough military for firing crew.\n");
|
pr("Not enough military for firing crew.\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,6 @@ newe(void)
|
||||||
if (twork > bwork) {
|
if (twork > bwork) {
|
||||||
twork = bwork;
|
twork = bwork;
|
||||||
}
|
}
|
||||||
work -= twork;
|
|
||||||
bwork -= twork;
|
bwork -= twork;
|
||||||
eff -= twork * 4;
|
eff -= twork * 4;
|
||||||
if (eff <= 0) {
|
if (eff <= 0) {
|
||||||
|
@ -103,7 +102,6 @@ newe(void)
|
||||||
if (twork > hcms)
|
if (twork > hcms)
|
||||||
twork = hcms;
|
twork = hcms;
|
||||||
}
|
}
|
||||||
work -= twork;
|
|
||||||
eff += twork;
|
eff += twork;
|
||||||
} else if (eff < 100) {
|
} else if (eff < 100) {
|
||||||
twork = 100 - eff;
|
twork = 100 - eff;
|
||||||
|
@ -122,7 +120,6 @@ newe(void)
|
||||||
if (twork > hcms)
|
if (twork > hcms)
|
||||||
twork = hcms;
|
twork = hcms;
|
||||||
}
|
}
|
||||||
work -= twork;
|
|
||||||
eff += twork;
|
eff += twork;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -60,7 +60,7 @@ int
|
||||||
orde(void)
|
orde(void)
|
||||||
{
|
{
|
||||||
int diffeachship = 0;
|
int diffeachship = 0;
|
||||||
int orders, sub, level;
|
int sub, level;
|
||||||
int scuttling = 0;
|
int scuttling = 0;
|
||||||
struct nstr_item nb;
|
struct nstr_item nb;
|
||||||
struct shpstr ship;
|
struct shpstr ship;
|
||||||
|
@ -121,7 +121,6 @@ orde(void)
|
||||||
ship.shp_autonav &= ~AN_STANDBY;
|
ship.shp_autonav &= ~AN_STANDBY;
|
||||||
break;
|
break;
|
||||||
case 'd': /* declare path */
|
case 'd': /* declare path */
|
||||||
orders = 0;
|
|
||||||
scuttling = 0;
|
scuttling = 0;
|
||||||
/* Need location */
|
/* Need location */
|
||||||
p = getstarg(player->argp[3], "Destination? ", buf);
|
p = getstarg(player->argp[3], "Destination? ", buf);
|
||||||
|
@ -132,32 +131,27 @@ orde(void)
|
||||||
p1x = p0x;
|
p1x = p0x;
|
||||||
p1y = p0y;
|
p1y = p0y;
|
||||||
|
|
||||||
|
p = getstarg(player->argp[4], "Second dest? ", buf);
|
||||||
|
if (!p)
|
||||||
if (!orders) {
|
return RET_FAIL;
|
||||||
p = getstarg(player->argp[4], "Second dest? ", buf);
|
if (!*p || !strcmp(p, "-")) {
|
||||||
if (!p)
|
pr("A one-way order has been accepted.\n");
|
||||||
return RET_FAIL;
|
} else if (!strncmp(p, "s", 1)) {
|
||||||
if (!*p || !strcmp(p, "-")) {
|
if (opt_TRADESHIPS) {
|
||||||
orders = 1;
|
if (!(mchr[(int)ship.shp_type].m_flags & M_TRADE)) {
|
||||||
pr("A one-way order has been accepted.\n");
|
|
||||||
} else if (!strncmp(p, "s", 1)) {
|
|
||||||
if (opt_TRADESHIPS) {
|
|
||||||
if (!(mchr[(int)ship.shp_type].m_flags & M_TRADE)) {
|
|
||||||
pr("You can't auto-scuttle that ship!\n");
|
|
||||||
return RET_SYN;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
pr("You can't auto-scuttle that ship!\n");
|
pr("You can't auto-scuttle that ship!\n");
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
}
|
}
|
||||||
pr("A scuttle order has been accepted.\n");
|
|
||||||
scuttling = 1;
|
|
||||||
} else {
|
} else {
|
||||||
if (!sarg_xy(p, &p1x, &p1y))
|
pr("You can't auto-scuttle that ship!\n");
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
pr("A circular order has been accepted.\n");
|
|
||||||
}
|
}
|
||||||
|
pr("A scuttle order has been accepted.\n");
|
||||||
|
scuttling = 1;
|
||||||
|
} else {
|
||||||
|
if (!sarg_xy(p, &p1x, &p1y))
|
||||||
|
return RET_SYN;
|
||||||
|
pr("A circular order has been accepted.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -200,56 +194,53 @@ orde(void)
|
||||||
sub = sub - 1;;
|
sub = sub - 1;;
|
||||||
|
|
||||||
if (ship.shp_autonav & AN_AUTONAV) {
|
if (ship.shp_autonav & AN_AUTONAV) {
|
||||||
orders = 1;
|
|
||||||
dest = getstarg(player->argp[4], "Start or End? ", buf);
|
dest = getstarg(player->argp[4], "Start or End? ", buf);
|
||||||
if (orders) { /* before dest check */
|
if (!dest)
|
||||||
if (!dest)
|
break;
|
||||||
break;
|
switch (*dest) {
|
||||||
switch (*dest) {
|
default:
|
||||||
default:
|
pr("You must enter 'start' or 'end'\n");
|
||||||
pr("You must enter 'start' or 'end'\n");
|
return RET_SYN;
|
||||||
return RET_SYN;
|
case 'e':
|
||||||
case 'e':
|
case 'E':
|
||||||
case 'E':
|
i1 = whatitem(player->argp[5], "Commodity? ");
|
||||||
i1 = whatitem(player->argp[5], "Commodity? ");
|
if (!i1)
|
||||||
if (!i1)
|
|
||||||
break;
|
|
||||||
else {
|
|
||||||
p1 = getstarg(player->argp[6], "Amount? ",
|
|
||||||
buf);
|
|
||||||
if (!p1)
|
|
||||||
return RET_SYN;
|
|
||||||
level = atoi(p1);
|
|
||||||
}
|
|
||||||
if (level < 0) {
|
|
||||||
level = 0; /* prevent negatives. */
|
|
||||||
pr("You must use positive number! Level set to 0.\n");
|
|
||||||
}
|
|
||||||
ship.shp_tstart[sub] = i1->i_uid;
|
|
||||||
ship.shp_lstart[sub] = level;
|
|
||||||
pr("Order Set \n");
|
|
||||||
break;
|
|
||||||
case 's':
|
|
||||||
case 'S':
|
|
||||||
i1 = whatitem(player->argp[5], "Commodity? ");
|
|
||||||
if (!i1)
|
|
||||||
break;
|
|
||||||
else {
|
|
||||||
p1 = getstarg(player->argp[6], "Amount? ",
|
|
||||||
buf);
|
|
||||||
if (!p1)
|
|
||||||
return RET_SYN;
|
|
||||||
level = atoi(p1);
|
|
||||||
}
|
|
||||||
if (level < 0) {
|
|
||||||
level = 0;
|
|
||||||
pr("You must use positive number! Level set to 0.\n");
|
|
||||||
}
|
|
||||||
ship.shp_tend[sub] = i1->i_uid;
|
|
||||||
ship.shp_lend[sub] = level;
|
|
||||||
pr("Order Set \n");
|
|
||||||
break;
|
break;
|
||||||
|
else {
|
||||||
|
p1 = getstarg(player->argp[6], "Amount? ",
|
||||||
|
buf);
|
||||||
|
if (!p1)
|
||||||
|
return RET_SYN;
|
||||||
|
level = atoi(p1);
|
||||||
}
|
}
|
||||||
|
if (level < 0) {
|
||||||
|
level = 0; /* prevent negatives. */
|
||||||
|
pr("You must use positive number! Level set to 0.\n");
|
||||||
|
}
|
||||||
|
ship.shp_tstart[sub] = i1->i_uid;
|
||||||
|
ship.shp_lstart[sub] = level;
|
||||||
|
pr("Order Set \n");
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
case 'S':
|
||||||
|
i1 = whatitem(player->argp[5], "Commodity? ");
|
||||||
|
if (!i1)
|
||||||
|
break;
|
||||||
|
else {
|
||||||
|
p1 = getstarg(player->argp[6], "Amount? ",
|
||||||
|
buf);
|
||||||
|
if (!p1)
|
||||||
|
return RET_SYN;
|
||||||
|
level = atoi(p1);
|
||||||
|
}
|
||||||
|
if (level < 0) {
|
||||||
|
level = 0;
|
||||||
|
pr("You must use positive number! Level set to 0.\n");
|
||||||
|
}
|
||||||
|
ship.shp_tend[sub] = i1->i_uid;
|
||||||
|
ship.shp_lend[sub] = level;
|
||||||
|
pr("Order Set \n");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
pr("You need to 'declare' a ship path first, see 'info order'\n");
|
pr("You need to 'declare' a ship path first, see 'info order'\n");
|
||||||
|
|
|
@ -57,7 +57,6 @@ sell(void)
|
||||||
struct ichrstr *ip;
|
struct ichrstr *ip;
|
||||||
struct comstr comm;
|
struct comstr comm;
|
||||||
int number_set;
|
int number_set;
|
||||||
int number_sub;
|
|
||||||
int totalcom;
|
int totalcom;
|
||||||
int amt;
|
int amt;
|
||||||
int com;
|
int com;
|
||||||
|
@ -99,7 +98,6 @@ sell(void)
|
||||||
pr("Sectors need at least 1 mobility to sell goods.\n");
|
pr("Sectors need at least 1 mobility to sell goods.\n");
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
number_sub = 0;
|
|
||||||
p = getstarg(player->argp[3], "Quantity: ", buf);
|
p = getstarg(player->argp[3], "Quantity: ", buf);
|
||||||
if (!p || !*p)
|
if (!p || !*p)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
|
|
|
@ -127,7 +127,6 @@ buildeff(struct sctstr *sp, int work, double *money)
|
||||||
int n, hcms, lcms;
|
int n, hcms, lcms;
|
||||||
int effdone = 0;
|
int effdone = 0;
|
||||||
|
|
||||||
work_cost = 0;
|
|
||||||
if (sp->sct_type != sp->sct_newtype) {
|
if (sp->sct_type != sp->sct_newtype) {
|
||||||
/*
|
/*
|
||||||
* Tear down existing sector.
|
* Tear down existing sector.
|
||||||
|
|
|
@ -125,7 +125,6 @@ bestownedpath(char *bpath, char *bigmap,
|
||||||
|
|
||||||
routelen = 0; /* path length is now 0 */
|
routelen = 0; /* path length is now 0 */
|
||||||
mapindex[x][y] = 0; /* mark starting spot */
|
mapindex[x][y] = 0; /* mark starting spot */
|
||||||
markedsectors = 1; /* source sector marked */
|
|
||||||
minx = x - 2; /* set X scan bounds */
|
minx = x - 2; /* set X scan bounds */
|
||||||
maxx = x + 2;
|
maxx = x + 2;
|
||||||
miny = y - 1; /* set Y scan bounds */
|
miny = y - 1; /* set Y scan bounds */
|
||||||
|
|
|
@ -420,7 +420,6 @@ ac_airtoair(struct emp_qelem *att_list, struct emp_qelem *int_list)
|
||||||
struct plist *interceptor;
|
struct plist *interceptor;
|
||||||
struct emp_qelem *att;
|
struct emp_qelem *att;
|
||||||
struct emp_qelem *in;
|
struct emp_qelem *in;
|
||||||
int nplanes;
|
|
||||||
int more_att;
|
int more_att;
|
||||||
int more_int;
|
int more_int;
|
||||||
struct emp_qelem *att_next;
|
struct emp_qelem *att_next;
|
||||||
|
@ -439,9 +438,6 @@ ac_airtoair(struct emp_qelem *att_list, struct emp_qelem *int_list)
|
||||||
att_next = att->q_forw;
|
att_next = att->q_forw;
|
||||||
attacker = (struct plist *)att;
|
attacker = (struct plist *)att;
|
||||||
interceptor = (struct plist *)in;
|
interceptor = (struct plist *)in;
|
||||||
nplanes = attacker->plane.pln_effic;
|
|
||||||
if (nplanes > interceptor->plane.pln_effic)
|
|
||||||
nplanes = interceptor->plane.pln_effic;
|
|
||||||
ac_dog(attacker, interceptor);
|
ac_dog(attacker, interceptor);
|
||||||
in = in_next;
|
in = in_next;
|
||||||
att = att_next;
|
att = att_next;
|
||||||
|
@ -751,8 +747,6 @@ ac_fireflak(struct emp_qelem *list, natid from, int guns)
|
||||||
struct emp_qelem *next;
|
struct emp_qelem *next;
|
||||||
char msg[255];
|
char msg[255];
|
||||||
|
|
||||||
plp = (struct plist *)list->q_forw;
|
|
||||||
|
|
||||||
for (qp = list->q_forw; qp != list; qp = next) {
|
for (qp = list->q_forw; qp != list; qp = next) {
|
||||||
next = qp->q_forw;
|
next = qp->q_forw;
|
||||||
plp = (struct plist *)qp;
|
plp = (struct plist *)qp;
|
||||||
|
|
|
@ -99,7 +99,6 @@ print_shiplist(struct shiplist *head)
|
||||||
{
|
{
|
||||||
struct shiplist *s;
|
struct shiplist *s;
|
||||||
int first;
|
int first;
|
||||||
struct mchrstr *mp;
|
|
||||||
struct shpstr ship;
|
struct shpstr ship;
|
||||||
|
|
||||||
s = head;
|
s = head;
|
||||||
|
@ -107,7 +106,6 @@ print_shiplist(struct shiplist *head)
|
||||||
|
|
||||||
while (s != NULL) {
|
while (s != NULL) {
|
||||||
getship(s->uid, &ship);
|
getship(s->uid, &ship);
|
||||||
mp = &mchr[(int)ship.shp_type];
|
|
||||||
if (first) {
|
if (first) {
|
||||||
pr(" # player->owner eff type\n");
|
pr(" # player->owner eff type\n");
|
||||||
first = 0;
|
first = 0;
|
||||||
|
|
|
@ -54,7 +54,7 @@ blankfill(char *ptr, struct range *range, int size)
|
||||||
p = ptr;
|
p = ptr;
|
||||||
while (--col >= 0)
|
while (--col >= 0)
|
||||||
*p++ = ' ';
|
*p++ = ' ';
|
||||||
*p++ = 0;
|
*p = 0;
|
||||||
ptr += MAPWIDTH(size);
|
ptr += MAPWIDTH(size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,10 +178,9 @@ lnd_take_casualty(int combat_mode, struct ulist *llp, int cas)
|
||||||
|
|
||||||
taken = llp->unit.land.lnd_item[I_MILIT];
|
taken = llp->unit.land.lnd_item[I_MILIT];
|
||||||
/* Spies always die */
|
/* Spies always die */
|
||||||
if (((struct lchrstr *)llp->chrp)->l_flags & L_SPY) {
|
if (((struct lchrstr *)llp->chrp)->l_flags & L_SPY)
|
||||||
eff_eq = 100;
|
|
||||||
llp->unit.land.lnd_effic = 0;
|
llp->unit.land.lnd_effic = 0;
|
||||||
} else {
|
else {
|
||||||
eff_eq = ldround(cas * 100.0 /
|
eff_eq = ldround(cas * 100.0 /
|
||||||
((struct lchrstr *)llp->chrp)->l_item[I_MILIT], 1);
|
((struct lchrstr *)llp->chrp)->l_item[I_MILIT], 1);
|
||||||
llp->unit.land.lnd_effic -= eff_eq;
|
llp->unit.land.lnd_effic -= eff_eq;
|
||||||
|
@ -1054,7 +1053,6 @@ lnd_mar_one_sector(struct emp_qelem *list, int dir, natid actor,
|
||||||
/* move survivors to done */
|
/* move survivors to done */
|
||||||
for (qp = cur.q_back; qp != &cur; qp = next) {
|
for (qp = cur.q_back; qp != &cur; qp = next) {
|
||||||
next = qp->q_back;
|
next = qp->q_back;
|
||||||
llp = (struct ulist *)qp;
|
|
||||||
emp_remque(qp);
|
emp_remque(qp);
|
||||||
emp_insque(qp, &done);
|
emp_insque(qp, &done);
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,6 @@ draw_map(int bmap, char origin, int map_flags, struct nstr_sect *nsp)
|
||||||
switch (bmap) {
|
switch (bmap) {
|
||||||
default:
|
default:
|
||||||
CANT_REACH();
|
CANT_REACH();
|
||||||
bmap = 'b';
|
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case 'b':
|
case 'b':
|
||||||
while (bmnxtsct(nsp) && !player->aborted) {
|
while (bmnxtsct(nsp) && !player->aborted) {
|
||||||
|
|
|
@ -1075,7 +1075,6 @@ air_damage(struct emp_qelem *bombers, coord x, coord y, int mission,
|
||||||
if (!plp->load)
|
if (!plp->load)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
newdam = 0;
|
|
||||||
if (plp->pcp->pl_flags & P_A) {
|
if (plp->pcp->pl_flags & P_A) {
|
||||||
if (roll(100) > pln_identchance(pp, hardtarget, EF_SHIP)) {
|
if (roll(100) > pln_identchance(pp, hardtarget, EF_SHIP)) {
|
||||||
wu(0, pp->pln_own,
|
wu(0, pp->pln_own,
|
||||||
|
|
|
@ -216,7 +216,6 @@ msl_intercept(struct plnstr *msl, struct sctstr *sp, int sublaunch,
|
||||||
int news_item)
|
int news_item)
|
||||||
{
|
{
|
||||||
struct plnstr *pp;
|
struct plnstr *pp;
|
||||||
struct plchrstr *pcp;
|
|
||||||
struct emp_qelem *intlist;
|
struct emp_qelem *intlist;
|
||||||
struct emp_qelem intfoo;
|
struct emp_qelem intfoo;
|
||||||
struct emp_qelem *qp;
|
struct emp_qelem *qp;
|
||||||
|
@ -236,7 +235,6 @@ msl_intercept(struct plnstr *msl, struct sctstr *sp, int sublaunch,
|
||||||
pp = &ip->plane;
|
pp = &ip->plane;
|
||||||
if (pp->pln_own != sp->sct_own)
|
if (pp->pln_own != sp->sct_own)
|
||||||
continue;
|
continue;
|
||||||
pcp = ip->pcp;
|
|
||||||
if (mission_pln_equip(ip, NULL, 'i') < 0) {
|
if (mission_pln_equip(ip, NULL, 'i') < 0) {
|
||||||
emp_remque(qp);
|
emp_remque(qp);
|
||||||
free(qp);
|
free(qp);
|
||||||
|
@ -255,7 +253,6 @@ msl_intercept(struct plnstr *msl, struct sctstr *sp, int sublaunch,
|
||||||
next = qp->q_forw;
|
next = qp->q_forw;
|
||||||
ip = (struct plist *)qp;
|
ip = (struct plist *)qp;
|
||||||
pp = &ip->plane;
|
pp = &ip->plane;
|
||||||
pcp = ip->pcp;
|
|
||||||
if (mission_pln_equip(ip, NULL, 'i') < 0) {
|
if (mission_pln_equip(ip, NULL, 'i') < 0) {
|
||||||
emp_remque(qp);
|
emp_remque(qp);
|
||||||
free(qp);
|
free(qp);
|
||||||
|
@ -287,7 +284,6 @@ msl_intercept(struct plnstr *msl, struct sctstr *sp, int sublaunch,
|
||||||
qp = intlist->q_forw;
|
qp = intlist->q_forw;
|
||||||
ip = (struct plist *)qp;
|
ip = (struct plist *)qp;
|
||||||
pp = &ip->plane;
|
pp = &ip->plane;
|
||||||
pcp = ip->pcp;
|
|
||||||
|
|
||||||
mpr(msl->pln_own, "%s %s launched in defense!\n",
|
mpr(msl->pln_own, "%s %s launched in defense!\n",
|
||||||
cname(pp->pln_own), def_name);
|
cname(pp->pln_own), def_name);
|
||||||
|
|
|
@ -145,7 +145,6 @@ retreat_ship1(struct shpstr *sp, char code, int orig)
|
||||||
if (sp->shp_own == 0)
|
if (sp->shp_own == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
n = 0;
|
|
||||||
if (sp->shp_effic < SHIP_MINEFF) {
|
if (sp->shp_effic < SHIP_MINEFF) {
|
||||||
wu(0, sp->shp_own,
|
wu(0, sp->shp_own,
|
||||||
"%s %s,\nbut it died in the attack, and so couldn't retreat!\n",
|
"%s %s,\nbut it died in the attack, and so couldn't retreat!\n",
|
||||||
|
@ -405,7 +404,6 @@ retreat_land1(struct lndstr *lp, char code, int orig)
|
||||||
if (lp->lnd_own == 0)
|
if (lp->lnd_own == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
n = 0;
|
|
||||||
if (lp->lnd_effic < LAND_MINEFF) {
|
if (lp->lnd_effic < LAND_MINEFF) {
|
||||||
wu(0, lp->lnd_own,
|
wu(0, lp->lnd_own,
|
||||||
"%s %s,\nbut it died in the attack, and so couldn't retreat!\n",
|
"%s %s,\nbut it died in the attack, and so couldn't retreat!\n",
|
||||||
|
|
|
@ -130,7 +130,6 @@ takeover(struct sctstr *sp, natid newown)
|
||||||
* n: random number from -25:75 + (50 - loyalty)
|
* n: random number from -25:75 + (50 - loyalty)
|
||||||
*/
|
*/
|
||||||
n = (50 - sp->sct_loyal) + ((random() % 100) - 25);
|
n = (50 - sp->sct_loyal) + ((random() % 100) - 25);
|
||||||
che_count = 0;
|
|
||||||
if (n > 0 && sp->sct_own == sp->sct_oldown) {
|
if (n > 0 && sp->sct_own == sp->sct_oldown) {
|
||||||
che_count = (civ * n / 3000) + 5;
|
che_count = (civ * n / 3000) + 5;
|
||||||
if (che_count * 2 > civ)
|
if (che_count * 2 > civ)
|
||||||
|
|
|
@ -50,7 +50,6 @@ deliver(struct sctstr *from, struct ichrstr *ip, int dir,
|
||||||
int amt_dst;
|
int amt_dst;
|
||||||
int mobility;
|
int mobility;
|
||||||
double mcost;
|
double mcost;
|
||||||
struct dchrstr *dp;
|
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (dir <= 0 || dir > DIR_UL)
|
if (dir <= 0 || dir > DIR_UL)
|
||||||
|
@ -73,7 +72,6 @@ deliver(struct sctstr *from, struct ichrstr *ip, int dir,
|
||||||
ip->i_name, ownxy(from));
|
ip->i_name, ownxy(from));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
dp = &dchr[from->sct_type];
|
|
||||||
vtype = ip->i_uid;
|
vtype = ip->i_uid;
|
||||||
mobility = from->sct_mobil / 2;
|
mobility = from->sct_mobil / 2;
|
||||||
if (vtype == I_CIVIL) {
|
if (vtype == I_CIVIL) {
|
||||||
|
|
|
@ -272,8 +272,6 @@ nav_ship(struct shpstr *sp)
|
||||||
mlp->mobil = sp->shp_mobil;
|
mlp->mobil = sp->shp_mobil;
|
||||||
emp_insque(&mlp->queue, &ship_list);
|
emp_insque(&mlp->queue, &ship_list);
|
||||||
|
|
||||||
quit = 1; /* setup loop, we want to check it 1 time. */
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if ((sp->shp_mobil > 0) && (!(sp->shp_autonav & AN_LOADING)) &&
|
if ((sp->shp_mobil > 0) && (!(sp->shp_autonav & AN_LOADING)) &&
|
||||||
(!(sp->shp_autonav & AN_STANDBY))) {
|
(!(sp->shp_autonav & AN_STANDBY))) {
|
||||||
|
|
|
@ -62,7 +62,6 @@ revolt(struct sctstr *sp)
|
||||||
if (che > (civ + uw) * 3)
|
if (che > (civ + uw) * 3)
|
||||||
return;
|
return;
|
||||||
che_uw = 0;
|
che_uw = 0;
|
||||||
che_civ = 0;
|
|
||||||
/* che due to civilian unrest */
|
/* che due to civilian unrest */
|
||||||
n = 10 - (random() % 20);
|
n = 10 - (random() % 20);
|
||||||
che_civ = 3 + (civ * n / 500);
|
che_civ = 3 + (civ * n / 500);
|
||||||
|
@ -254,7 +253,6 @@ guerrilla(struct sctstr *sp)
|
||||||
* guerrillas have to resort to blowing things up.
|
* guerrillas have to resort to blowing things up.
|
||||||
* Note this disrupts work in the sector.
|
* Note this disrupts work in the sector.
|
||||||
*/
|
*/
|
||||||
n = 0;
|
|
||||||
n = (random() % 10) + (random() % che);
|
n = (random() % 10) + (random() % che);
|
||||||
if (n > 100)
|
if (n > 100)
|
||||||
n = 100;
|
n = 100;
|
||||||
|
|
|
@ -275,7 +275,6 @@ shiprepair(struct shpstr *ship, struct natstr *np, struct bp *bp, int etus)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wf = 0;
|
|
||||||
/* only military can work on a military boat */
|
/* only military can work on a military boat */
|
||||||
if (mp->m_glim != 0)
|
if (mp->m_glim != 0)
|
||||||
wf = etus * ship->shp_item[I_MILIT] / 2;
|
wf = etus * ship->shp_item[I_MILIT] / 2;
|
||||||
|
|
|
@ -1166,7 +1166,6 @@ write_newcap_script(void)
|
||||||
fprintf(script, "newcap %d %d,%d\n", c + 1, capx[c], capy[c]);
|
fprintf(script, "newcap %d %d,%d\n", c + 1, capx[c], capy[c]);
|
||||||
}
|
}
|
||||||
fprintf(script, "add %d visitor visitor v i\n", c + 1);
|
fprintf(script, "add %d visitor visitor v i\n", c + 1);
|
||||||
++c;
|
|
||||||
fclose(script);
|
fclose(script);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue