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.
This commit is contained in:
Markus Armbruster 2008-08-02 17:28:05 -04:00
parent 3a9545fe99
commit 6a95e67e4f
2 changed files with 4 additions and 0 deletions

View file

@ -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