(getilist, att_get_combat): Simplify. No functional changes.
This commit is contained in:
parent
ade0e97856
commit
99bfa19a92
2 changed files with 8 additions and 10 deletions
|
@ -1044,7 +1044,7 @@ getilist(struct emp_qelem *list, natid own, struct emp_qelem *a,
|
|||
struct lndstr land;
|
||||
struct sctstr sect;
|
||||
struct nstr_item ni;
|
||||
u_short *item;
|
||||
int petrol;
|
||||
struct plist *ip;
|
||||
|
||||
emp_initque(list);
|
||||
|
@ -1065,15 +1065,15 @@ getilist(struct emp_qelem *list, natid own, struct emp_qelem *a,
|
|||
if (!can_fly(plane.pln_uid))
|
||||
continue;
|
||||
getship(plane.pln_ship, &ship);
|
||||
item = ship.shp_item;
|
||||
petrol = ship.shp_item[I_PETROL];
|
||||
} else if (plane.pln_land >= 0) {
|
||||
if (!can_fly(plane.pln_uid))
|
||||
continue;
|
||||
getland(plane.pln_land, &land);
|
||||
item = land.lnd_item;
|
||||
petrol = land.lnd_item[I_PETROL];
|
||||
} else {
|
||||
getsect(plane.pln_x, plane.pln_y, §);
|
||||
item = sect.sct_item;
|
||||
petrol = sect.sct_item[I_PETROL];
|
||||
#if 0
|
||||
if (sect.sct_effic < 60 && (pcp->pl_flags & P_V) == 0)
|
||||
continue;
|
||||
|
@ -1083,7 +1083,7 @@ getilist(struct emp_qelem *list, natid own, struct emp_qelem *a,
|
|||
continue;
|
||||
#endif
|
||||
}
|
||||
if ((float)item[I_PETROL] < (float)pcp->pl_fuel / 2.0)
|
||||
if ((float)petrol < (float)pcp->pl_fuel / 2.0)
|
||||
continue;
|
||||
/* Finally, is it in the list of planes already in
|
||||
flight? */
|
||||
|
|
|
@ -203,7 +203,6 @@ att_get_combat(struct combat *com, int isdef)
|
|||
struct sctstr sect;
|
||||
struct shpstr ship;
|
||||
struct lndstr land;
|
||||
u_short *item;
|
||||
int pstage;
|
||||
natid owner;
|
||||
int mil;
|
||||
|
@ -219,7 +218,7 @@ att_get_combat(struct combat *com, int isdef)
|
|||
}
|
||||
com->sct_type = sect.sct_type;
|
||||
com->sct_dcp = &dchr[sect.sct_type];
|
||||
item = sect.sct_item;
|
||||
mil = sect.sct_item[I_MILIT];
|
||||
pstage = sect.sct_pstage;
|
||||
owner = sect.sct_own;
|
||||
eff = sect.sct_effic;
|
||||
|
@ -239,7 +238,7 @@ att_get_combat(struct combat *com, int isdef)
|
|||
return att_combat_init(com, EF_BAD);
|
||||
}
|
||||
com->lnd_lcp = &lchr[(int)land.lnd_type];
|
||||
item = land.lnd_item;
|
||||
mil = land.lnd_item[I_MILIT];
|
||||
pstage = land.lnd_pstage;
|
||||
owner = land.lnd_own;
|
||||
eff = land.lnd_effic;
|
||||
|
@ -276,7 +275,7 @@ att_get_combat(struct combat *com, int isdef)
|
|||
pr("Ship #%d is not your ship!\n", com->shp_uid);
|
||||
return att_combat_init(com, EF_BAD);
|
||||
}
|
||||
item = ship.shp_item;
|
||||
mil = ship.shp_item[I_MILIT];
|
||||
pstage = ship.shp_pstage;
|
||||
owner = ship.shp_own;
|
||||
eff = ship.shp_effic;
|
||||
|
@ -292,7 +291,6 @@ att_get_combat(struct combat *com, int isdef)
|
|||
return att_combat_init(com, EF_BAD);
|
||||
}
|
||||
|
||||
mil = item[I_MILIT];
|
||||
if (!com->set) { /* first time */
|
||||
if (isdef) { /* defender */
|
||||
com->troops = mil;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue