engineers. This affecs command `fortify'.
extern int has_units(coord, coord, natid, struct lndstr *);
extern int has_units_with_mob(coord, coord, natid);
extern int adj_units(coord, coord, natid);
-extern int is_engineer(int x, int y);
+extern int has_helpful_engineer(coord x, coord y, natid cn);
/* log.c */
extern void loginit(void);
extern void logerror(s_char *, ...);
return 0;
}
+/*
+ * Is there a engineer unit at X,Y that can help nation CN?
+ */
int
-is_engineer(int x, int y)
+has_helpful_engineer(coord x, coord y, natid cn)
{
struct nstr_item ni;
struct lndstr land;
snxtitem_xy(&ni, EF_LAND, x, y);
while (nxtitem(&ni, (s_char *)&land)) {
+ if (land.lnd_own != cn && getrel(getnatp(land.lnd_own), cn) != ALLIED)
+ continue;
if (lchr[(int)land.lnd_type].l_flags & L_ENGINEER)
return 1;
}
if ((lp->lnd_harden + hard_amt) > land_mob_max)
hard_amt = land_mob_max - lp->lnd_harden;
- eng = is_engineer(lp->lnd_x, lp->lnd_y);
+ eng = has_helpful_engineer(lp->lnd_x, lp->lnd_y, lp->lnd_own);
if (eng)
hard_amt = ((float)hard_amt * 1.5);