Eliminate a few pointless relations variables

Just to make the next few commits easier to review.
This commit is contained in:
Markus Armbruster 2011-01-29 13:09:26 +01:00
parent bb5cd07ce5
commit 7ebbe7da4c
5 changed files with 13 additions and 25 deletions

View file

@ -603,7 +603,6 @@ ac_shipflak(struct emp_qelem *list, coord x, coord y)
struct mchrstr *mcp;
double flak, total, ngun;
int gun;
int rel;
struct plist *plp;
natid plane_owner;
natid from;
@ -619,8 +618,7 @@ ac_shipflak(struct emp_qelem *list, coord x, coord y)
mcp = &mchr[(int)ship.shp_type];
if (mcp->m_flags & M_SUB)
continue;
rel = getrel(getnatp(ship.shp_own), plane_owner);
if (rel > HOSTILE)
if (getrel(getnatp(ship.shp_own), plane_owner) > HOSTILE)
continue;
gun = shp_usable_guns(&ship);
if (gun == 0)
@ -653,7 +651,6 @@ ac_landflak(struct emp_qelem *list, coord x, coord y)
struct lchrstr *lcp;
double flak, total, ngun;
int aaf, gun;
int rel;
struct plist *plp;
natid plane_owner;
natid from;
@ -672,8 +669,7 @@ ac_landflak(struct emp_qelem *list, coord x, coord y)
continue;
if (land.lnd_ship >= 0 || land.lnd_land >= 0)
continue;
rel = getrel(getnatp(land.lnd_own), plane_owner);
if (rel > HOSTILE)
if (getrel(getnatp(land.lnd_own), plane_owner) > HOSTILE)
continue;
flak = aaf * 1.5 * land.lnd_effic / 100.0;
ngun += flak;

View file

@ -468,7 +468,6 @@ lnd_mar(struct emp_qelem *list, double *minmobp, double *maxmobp,
coord ally;
int first = 1;
char mess[128];
int rel;
*minmobp = 9876.0;
*maxmobp = -9876.0;
@ -502,8 +501,8 @@ lnd_mar(struct emp_qelem *list, double *minmobp, double *maxmobp,
lnd_stays(actor, "has no mil on it to guide it", llp);
continue;
}
rel = getrel(getnatp(sect.sct_own), actor);
if (sect.sct_own != land.lnd_own && rel != ALLIED &&
if (sect.sct_own != land.lnd_own &&
getrel(getnatp(sect.sct_own), actor) != ALLIED &&
!(lchr[(int)llp->unit.land.lnd_type].l_flags & L_SPY) &&
sect.sct_own) {
sprintf(mess, "has been kidnapped by %s", cname(sect.sct_own));