]> git.pond.sub.org Git - empserver/commitdiff
Fix bomb not to let you p-bomb dead ships and land units
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Jul 2008 19:19:17 +0000 (15:19 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 12 Jul 2008 14:43:03 +0000 (10:43 -0400)
ASW planes bombing ships were not affected, because asw_shipsatxy()
excludes dead ships correctly.

src/lib/commands/bomb.c

index 5350a0a3cbaad0fcacb88cdb849284a833d579f4..975ca76873b79104f7d13cb9860840dc80739df4 100644 (file)
@@ -512,8 +512,8 @@ ship_bomb(struct emp_qelem *list, struct sctstr *target)
                continue;
            if ((plp->pcp->pl_flags & P_A) && !on_shiplist(n, head))
                continue;
-           if (getship(n, &ship) && ship.shp_x == target->sct_x &&
-               ship.shp_y == target->sct_y)
+           if (getship(n, &ship) && ship.shp_own &&
+               ship.shp_x == target->sct_x && ship.shp_y == target->sct_y)
                shipno = n;
        }
        if (shipno < 0)
@@ -743,7 +743,7 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
            n = atoi(q);
            if (n < 0)
                continue;
-           if (getland(n, &land) &&
+           if (getland(n, &land) && land.lnd_own &&
                land.lnd_x == target->sct_x && land.lnd_y == target->sct_y)
                unitno = n;
            else