From: Markus Armbruster Date: Sat, 2 Aug 2008 21:28:05 +0000 (-0400) Subject: Don't permit bombing of embarked planes and land units X-Git-Tag: v4.3.16~24 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=6a95e67e4f0216467af137609854fd55050085f0 Don't permit bombing of embarked planes and land units Change planesatxy() not to list embarked planes, plane_bomb() not to bomb them, and land_bomb() not to bomb embarked land units. Curiously, embarked land units were not listed as targets before, but could be bombed all the same. --- diff --git a/src/lib/commands/bomb.c b/src/lib/commands/bomb.c index 871335676..880f387a5 100644 --- a/src/lib/commands/bomb.c +++ b/src/lib/commands/bomb.c @@ -638,6 +638,7 @@ plane_bomb(struct emp_qelem *list, struct sctstr *target) if (getplane(n, &plane) && plane.pln_x == target->sct_x && plane.pln_y == target->sct_y && + plane.pln_ship < 0 && plane.pln_land < 0 && !(plane.pln_flags & PLN_LAUNCHED)) planeno = n; else @@ -741,6 +742,7 @@ land_bomb(struct emp_qelem *list, struct sctstr *target) if (n < 0) continue; if (getland(n, &land) && land.lnd_own && + land.lnd_ship < 0 && land.lnd_land < 0 && land.lnd_x == target->sct_x && land.lnd_y == target->sct_y) unitno = n; else diff --git a/src/lib/subs/list.c b/src/lib/subs/list.c index 567381e8b..13a35f5c6 100644 --- a/src/lib/subs/list.c +++ b/src/lib/subs/list.c @@ -178,6 +178,8 @@ planesatxy(coord x, coord y, int wantflags, int nowantflags) while (nxtitem(&ni, &plane)) { if (plane.pln_effic < PLANE_MINEFF || plane.pln_own == 0) continue; + if (plane.pln_ship >= 0 || plane.pln_land >= 0) + continue; if (plane.pln_flags & PLN_LAUNCHED) continue; plp = &plchr[(int)plane.pln_type];