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:
parent
3a9545fe99
commit
6a95e67e4f
2 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue