]> git.pond.sub.org Git - empserver/commitdiff
(get_assembly_point): Close loophole that allowed players to find all
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 4 Oct 2005 07:20:37 +0000 (07:20 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 4 Oct 2005 07:20:37 +0000 (07:20 +0000)
unowned sectors.  The assembly point must now be owned or allied, or
have an owned or allied ship.

Info pages didn't match the old rule.  Fix them to match the new rule.

info/Commands/bomb.t
info/Commands/drop.t
info/Commands/fly.t
info/Commands/paradrop.t
info/Commands/recon.t
info/Commands/sweep.t
src/lib/subs/plnsub.c

index 1f93461c3bc082cc2c72e2bdb7d3b306a282ab84..fe14ca1e828ec723ab7f2abda9ccfb1152f789c3 100644 (file)
@@ -31,7 +31,8 @@ Only missiles in hardened silos can avoid damage from a nuclear mission.
 .s1
 <SECT> represents an assembly point, where all of the planes in the
 mission meet before proceeding on to the target sector.
-The assembly point must be owned by you, and must not be more than
+The assembly point must be owned by you or an ally, or you or an ally
+must have a ship there.  It must not be more than
 four sectors away from any of the planes selected for the mission.
 .s1
 Route is a normal empire path specification. You may also give a 
index 56837b52f15c67cabdf6a85deece7bfb69bccd7f..d3db42dfda98fb244749fe999529d850929a71e0 100644 (file)
@@ -17,7 +17,8 @@ To be selected, escorts must have fuel and mobility.
 .s1
 <SECT> represents an assembly point, where all of the planes in the
 mission meet before proceeding on to the target sector.
-The assembly point must be owned by you, and must not be more than
+The assembly point must be owned by you or an ally, or you or an ally
+must have a ship there.  It must not be more than
 four sectors away from any of the planes selected for the mission.
 .s1
 <COMMODITY> is the name of a commodity which is to be carried along
index a9db852771d2fdb00dcbcbb9ab31fa906a904c3b..09339679f0dbff9d1b37621d6df00a427065e8d1 100644 (file)
@@ -16,7 +16,8 @@ To be selected, escorts must have fuel and mobility.
 .s1
 <SECT> represents an assembly point, where all of the planes in the
 mission meet before proceeding on to the target sector.
-The assembly point must be owned by you, and must not be more than
+The assembly point must be owned by you or an ally, or you or an ally
+must have a ship there.  It must not be more than
 four sectors away from any of the planes selected for the mission.
 .s1
 <COMMODITY> is the name of a commodity which is to be carried along
index 0987aa57fa0568a3f8d223d3b70bb458edb3f0dc..ba6e9dbfcecd6a129bc2f339a4f11d1328f13a00 100644 (file)
@@ -19,7 +19,8 @@ To be selected, escorts must have fuel and mobility.
 .s1
 <SECT> represents an assembly point, where all of the planes in the
 mission meet before proceeding on to the target sector.
-The assembly point must be owned by you, and must not be more than
+The assembly point must be owned by you or an ally, or you or an ally
+must have a ship there.  It must not be more than
 four sectors away from any of the planes selected for the mission.
 .s1
 Route is a normal empire path specification. You may also give a 
index 95029df365a8c13bbe7acf125f9546a1e915a162..2164ad39f0e552c6b2cbd2d33d2341f5078f52c2 100644 (file)
@@ -18,7 +18,8 @@ To be selected, escorts must have fuel and mobility.
 .s1
 <SECT> represents an assembly point, where all of the planes in the
 mission meet before proceeding on to the target sector.
-The assembly point must be owned by you, and must not be more than
+The assembly point must be owned by you or an ally, or you or an ally
+must have a ship there.  It must not be more than
 four sectors away from any of the planes selected for the mission.
 .s1
 Route is a normal empire path specification. You may also give a 
index 3da462228244abc7e6bb02d6f1a7e5262d327a46..e8e022feec6163ab7af68e5feada292a2e36b178 100644 (file)
@@ -17,7 +17,8 @@ To be selected, escorts must have fuel and mobility.
 .s1
 <SECT> represents an assembly point, where all of the planes in the
 mission meet before proceeding on to the target sector.
-The assembly point must be owned by you, and must not be more than
+The assembly point must be owned by you or an ally, or you or an ally
+must have a ship there.  It must not be more than
 four sectors away from any of the planes selected for the mission.
 .s1
 Route is a normal empire path specification. You may also give a 
index 7371f184ad0548765ab585fe5c225025ecb71954..6d7006b2943d5a861456012263baeb83a3f4a837 100644 (file)
@@ -64,18 +64,32 @@ get_assembly_point(char *input, struct sctstr *ap_sect, char *buf)
 {
     char *p;
     coord x, y;
+    struct nstr_item ni;
+    struct shpstr ship;
 
     p = getstarg(input, "assembly point? ", buf);
     if (!p || *p == 0)
        return NULL;
     if (!sarg_xy(p, &x, &y) || !getsect(x, y, ap_sect))
        return NULL;
-    if (ap_sect->sct_own && ap_sect->sct_own != player->cnum &&
-       getrel(getnatp(ap_sect->sct_own), player->cnum) != ALLIED) {
-       pr("Assembly point not owned by you or an ally!\n");
-       return NULL;
+
+    /* over own or allied sector is fine */
+    if (ap_sect->sct_own == player->cnum
+       || getrel(getnatp(ap_sect->sct_own), player->cnum) == ALLIED)
+       return ap_sect;
+
+    /* over own or allied ship is fine */
+    snxtitem_xy(&ni, EF_SHIP, x, y);
+    while (nxtitem(&ni, &ship)) {
+       if (ship.shp_effic < SHIP_MINEFF || ship.shp_own == 0)
+           continue;
+       if (ship.shp_own == player->cnum
+           || getrel(getnatp(ship.shp_own), player->cnum) == ALLIED)
+           return ap_sect;
     }
-    return ap_sect;
+
+    pr("Assembly point not owned by you or an ally!\n");
+    return NULL;
 }
 
 int