PR(plane_owner, " %d%% efficient ",
(sect.sct_own == plane_owner) ?
sect.sct_effic : roundintby((int)sect.sct_effic, 25));
- civ = getvar(V_CIVIL, (s_char *)§, EF_SECTOR);
- mil = getvar(V_MILIT, (s_char *)§, EF_SECTOR);
+ civ = sect.sct_item[I_CIVIL];
+ mil = sect.sct_item[I_MILIT];
if (civ)
PR(plane_owner, "with %s%d civ ",
(sect.sct_own == plane_owner) ?
plp = (struct plist *)list->q_forw;
plane_owner = plp->plane.pln_own;
- gun = getvar(V_GUN, (s_char *)from, EF_SECTOR);
- shell = getvar(V_SHELL, (s_char *)from, EF_SECTOR);
+ gun = from->sct_item[I_GUN];
+ shell = from->sct_item[I_SHELL];
add = 0;
if (shell < (gun / 2))
add = supply_commod(from->sct_own, from->sct_x, from->sct_y,
if (gun > 14)
gun = 14;
- putvar(V_SHELL, shell, (s_char *)from, EF_SECTOR);
+ from->sct_item[I_SHELL] = shell;
putsect(from);
gun = 2.0 * tfact(from->sct_own, (double)gun);
if (gun > 0) {
if (rel > HOSTILE)
continue;
shell = gun = 0;
- gun = min(getvar(V_GUN, (s_char *)&ship, EF_SHIP), ship.shp_glim);
+ gun = min(ship.shp_item[I_GUN], ship.shp_glim);
if (gun) {
- shell = getvar(V_SHELL, (s_char *)&ship, EF_SHIP);
+ shell = ship.shp_item[I_SHELL];
if (shell <= 0)
shell = supply_commod(ship.shp_own, ship.shp_x,
ship.shp_y, I_SHELL, 1);
}
PR(ship.shp_own, "firing %d flak guns from %s...\n",
firing, prship(&ship));
- putvar(V_SHELL, shell, (s_char *)&ship, EF_SHIP);
+ ship.shp_item[I_SHELL] = shell;
putship(ship.shp_uid, &ship);
from = ship.shp_own;
}
struct lndstr land;
struct sctstr sect;
struct nstr_item ni;
- int type;
- s_char *ptr;
+ u_short *item;
struct plist *ip;
emp_initque(list);
if (!can_fly(plane.pln_uid))
continue;
getship(plane.pln_ship, &ship);
- ptr = (s_char *)&ship;
- type = EF_SHIP;
+ item = ship.shp_item;
} else if (plane.pln_land >= 0) {
if (!can_fly(plane.pln_uid))
continue;
getland(plane.pln_land, &land);
- ptr = (s_char *)&land;
- type = EF_LAND;
+ item = land.lnd_item;
} else {
getsect(plane.pln_x, plane.pln_y, §);
- ptr = (s_char *)§
- type = EF_SECTOR;
+ item = sect.sct_item;
#if 0
if (sect.sct_effic < 60 && (pcp->pl_flags & P_V) == 0)
continue;
continue;
#endif
}
- if (((float)getvar(V_PETROL, ptr, type)) <
- (((float)pcp->pl_fuel) / 2.0))
+ if ((float)item[I_PETROL] < (float)pcp->pl_fuel / 2.0)
continue;
/* Finally, is it in the list of planes already in
flight? */