]> git.pond.sub.org Git - empserver/commitdiff
Check capabilities required for mission before range
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 14 Dec 2008 18:40:32 +0000 (13:40 -0500)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 25 Dec 2008 10:47:32 +0000 (11:47 +0100)
Checking range first could complain about range when the mission
couldn't work regardless of range.  Not helpful.

src/lib/commands/miss.c

index acd24b4e709093390f2fe7df831aae13dfd3d186..c8110e16a058ba5d6c43c61370ef56d1cb3b0cf8 100644 (file)
@@ -188,20 +188,6 @@ mission(void)
               obj_nameof(gp));
            continue;
        }
-       if (*p == '.') {
-           x = gp->x;
-           y = gp->y;
-       }
-
-       radius = oprange(gp, mission);
-       if (radius < mapdist(gp->x, gp->y, x, y)) {
-           pr("%s: out of range! (range %d)\n",
-              obj_nameof(gp), radius);
-           continue;
-       }
-
-       if (radius > desired_radius)
-           radius = desired_radius;
 
        if ((mission == MI_INTERDICT) && (type == EF_SHIP))
            if (mchr[(int)gp->type].m_glim == 0) {
@@ -264,6 +250,20 @@ mission(void)
            }
        }
 
+       if (*p == '.') {
+           x = gp->x;
+           y = gp->y;
+       }
+
+       radius = oprange(gp, mission);
+       if (radius < mapdist(gp->x, gp->y, x, y)) {
+           pr("%s: out of range! (range %d)\n",
+              obj_nameof(gp), radius);
+           continue;
+       }
+
+       if (radius > desired_radius)
+           radius = desired_radius;
        num++;                  /* good one.. go with it */
 
        pr("%s on %s mission, centered on %s, radius %d\n",