Fix bomb not to let you p-bomb dead ships and land units
ASW planes bombing ships were not affected, because asw_shipsatxy() excludes dead ships correctly.
This commit is contained in:
parent
dc41544a8f
commit
23d52a4147
1 changed files with 3 additions and 3 deletions
|
@ -512,8 +512,8 @@ ship_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||||
continue;
|
continue;
|
||||||
if ((plp->pcp->pl_flags & P_A) && !on_shiplist(n, head))
|
if ((plp->pcp->pl_flags & P_A) && !on_shiplist(n, head))
|
||||||
continue;
|
continue;
|
||||||
if (getship(n, &ship) && ship.shp_x == target->sct_x &&
|
if (getship(n, &ship) && ship.shp_own &&
|
||||||
ship.shp_y == target->sct_y)
|
ship.shp_x == target->sct_x && ship.shp_y == target->sct_y)
|
||||||
shipno = n;
|
shipno = n;
|
||||||
}
|
}
|
||||||
if (shipno < 0)
|
if (shipno < 0)
|
||||||
|
@ -743,7 +743,7 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||||
n = atoi(q);
|
n = atoi(q);
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
continue;
|
continue;
|
||||||
if (getland(n, &land) &&
|
if (getland(n, &land) && land.lnd_own &&
|
||||||
land.lnd_x == target->sct_x && land.lnd_y == target->sct_y)
|
land.lnd_x == target->sct_x && land.lnd_y == target->sct_y)
|
||||||
unitno = n;
|
unitno = n;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue