From: Markus Armbruster Date: Mon, 3 Mar 2008 06:29:24 +0000 (+0100) Subject: Change test whether a land unit is artillery X-Git-Tag: v4.3.12~116 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=69f441ef3991b5d34286a786cfc326b307f11759 Change test whether a land unit is artillery Test for land unit firing damage instead of range, for consistency with ships. --- diff --git a/src/lib/commands/mfir.c b/src/lib/commands/mfir.c index 08185a3f5..be1ee2dc6 100644 --- a/src/lib/commands/mfir.c +++ b/src/lib/commands/mfir.c @@ -149,7 +149,7 @@ multifire(void) if (item.land.lnd_own != player->cnum) continue; - if (fland.lnd_frg == 0) { + if (fland.lnd_dam == 0) { pr("Unit %d cannot fire!\n", fland.lnd_uid); continue; } @@ -357,7 +357,7 @@ multifire(void) fx = fland.lnd_x; fy = fland.lnd_y; - if (fland.lnd_frg == 0) { + if (fland.lnd_dam == 0) { pr("Unit %d cannot fire!\n", fland.lnd_uid); continue; } diff --git a/src/lib/commands/miss.c b/src/lib/commands/miss.c index 281618740..abf9d16f9 100644 --- a/src/lib/commands/miss.c +++ b/src/lib/commands/miss.c @@ -227,7 +227,7 @@ mission(void) } if ((mission == MI_INTERDICT) && (type == EF_LAND)) - if (lchr[(int)gp->type].l_frg < 1) { + if (lchr[(int)gp->type].l_dam == 0) { pr("%s: cannot fire at range!\n", obj_nameof(gp)); continue; } diff --git a/src/lib/subs/lndsub.c b/src/lib/subs/lndsub.c index e984c5267..a3ba6e90c 100644 --- a/src/lib/subs/lndsub.c +++ b/src/lib/subs/lndsub.c @@ -1136,7 +1136,7 @@ lnd_support(natid victim, natid attacker, coord x, coord y, int defending) snxtitem_all(&ni, EF_LAND); while (nxtitem(&ni, &land)) { - if (land.lnd_frg == 0) + if (land.lnd_dam == 0) continue; if ((land.lnd_x == x) && (land.lnd_y == y)) continue; diff --git a/src/lib/subs/supply.c b/src/lib/subs/supply.c index e1b0f988c..9c56da889 100644 --- a/src/lib/subs/supply.c +++ b/src/lib/subs/supply.c @@ -546,7 +546,7 @@ use_supply(struct lndstr *lp) lp->lnd_item[I_SHELL] = MAX(lp->lnd_item[I_SHELL] - shells_needed, 0); - if (lp->lnd_frg) /* artillery */ + if (lp->lnd_dam) /* artillery */ goto done; food_needed = get_minimum(lp, I_FOOD);