Don't let POGO (#0) navigate and march ghosts
POGO can navigate dead ships, and march dead land units. The ghosts even get sighted and interdicted, and can hit mines (landmines only until commitfe372539
, v4.3.27). Noted for ships in commit9100af0b
. Has always been broken. Fix by making shp_sel() and lnd_sel() explicitly reject ghosts. Same code pattern also exists in pln_sel, but dead plains fail the efficiency test, so it's harmless there. Apply the same fix anyway.
This commit is contained in:
parent
45d090b8c3
commit
617cb41f66
3 changed files with 3 additions and 3 deletions
|
@ -412,7 +412,7 @@ lnd_sel(struct nstr_item *ni, struct emp_qelem *list)
|
||||||
* but much of the code assumes that only the land unit's
|
* but much of the code assumes that only the land unit's
|
||||||
* owner can march it.
|
* owner can march it.
|
||||||
*/
|
*/
|
||||||
if (land.lnd_own != player->cnum)
|
if (!land.lnd_own || land.lnd_own != player->cnum)
|
||||||
continue;
|
continue;
|
||||||
if (opt_MARKET) {
|
if (opt_MARKET) {
|
||||||
if (ontradingblock(EF_LAND, &land)) {
|
if (ontradingblock(EF_LAND, &land)) {
|
||||||
|
|
|
@ -538,7 +538,7 @@ pln_sel(struct nstr_item *ni, struct emp_qelem *list, struct sctstr *ap,
|
||||||
* much of the code assumes that only the plane's owner can
|
* much of the code assumes that only the plane's owner can
|
||||||
* fly it.
|
* fly it.
|
||||||
*/
|
*/
|
||||||
if (plane.pln_own != player->cnum)
|
if (!plane.pln_own || plane.pln_own != player->cnum)
|
||||||
continue;
|
continue;
|
||||||
if (plane.pln_mobil <= 0)
|
if (plane.pln_mobil <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -70,7 +70,7 @@ shp_sel(struct nstr_item *ni, struct emp_qelem *list)
|
||||||
* much of the code assumes that only the ship's owner can
|
* much of the code assumes that only the ship's owner can
|
||||||
* navigate it.
|
* navigate it.
|
||||||
*/
|
*/
|
||||||
if (ship.shp_own != player->cnum)
|
if (!ship.shp_own || ship.shp_own != player->cnum)
|
||||||
continue;
|
continue;
|
||||||
mcp = &mchr[(int)ship.shp_type];
|
mcp = &mchr[(int)ship.shp_type];
|
||||||
if (opt_MARKET) {
|
if (opt_MARKET) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue