]> git.pond.sub.org Git - empserver/commitdiff
All missions now have op areas, simplify mission()
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 22 Nov 2008 20:19:27 +0000 (15:19 -0500)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 25 Dec 2008 10:47:32 +0000 (11:47 +0100)
info/mission.t
src/lib/commands/miss.c

index f299f442077f4cc4fe26a6980eb237a372f9449d..732fe606f0624de6520e087af8fe8975e5b071e3 100644 (file)
@@ -1,7 +1,7 @@
 .TH Command MISSION
 .NA mission "Assign a mission to a ship/plane/unit"
 .LV Basic
-.SY "mission <TYPE> <UNITS> <s|o|d|i|e|r|a|c|q> [<op sector|.>] [<radius>]"
+.SY "mission <TYPE> <UNITS> <s|o|d|i|e|r|a|c|q> <op sector|.> [<radius>]"
 .s1
 The mission command is used to assign ships, planes, or land units to
 missions. The available missions are:
@@ -63,7 +63,7 @@ on a sector until 100 damage is done.
 .s1
 OPERATIONS SECTORS
 .s1
-Some missions require the designation of an 'op sector', short for operations
+Missions require the designation of an 'op sector', short for operations
 sector. This is the center of an area that the mission is focused on.
 The op sector may be any sector that is within the unit's range.
 (Firing range for ships & land units on interdiction, reaction range
index d2c7e7a2bb6ca5e585c88357f8fc0465cf0a7501..40a667e9017e9bf7bcfa677e82900057588f4fdf 100644 (file)
@@ -205,10 +205,7 @@ mission(void)
 
        dist = mapdist(gp->x, gp->y, x, y);
        radius = 999;
-       if (mission == MI_INTERDICT || mission == MI_SUPPORT ||
-           mission == MI_OSUPPORT || mission == MI_DSUPPORT ||
-           mission == MI_RESERVE || mission == MI_ESCORT ||
-           mission == MI_AIR_DEFENSE) {
+       if (mission) {
            radius = oprange(gp, mission);
            if (radius < dist) {
                pr("%s: out of range! (range %d)\n",
@@ -283,28 +280,15 @@ mission(void)
 
        num++;                  /* good one.. go with it */
 
-       if (mission == MI_INTERDICT || mission == MI_SUPPORT ||
-           mission == MI_OSUPPORT || mission == MI_DSUPPORT ||
-           mission == MI_RESERVE || mission == MI_ESCORT ||
-           mission == MI_AIR_DEFENSE)
-           gp->radius = radius;
-       else
-           gp->radius = 0;
-
-       if (mission == MI_SUPPORT || mission == MI_OSUPPORT ||
-           mission == MI_DSUPPORT || mission == MI_INTERDICT ||
-           mission == MI_RESERVE || mission == MI_ESCORT ||
-           mission == MI_AIR_DEFENSE) {
+       if (mission) {
            pr("%s on %s mission, centered on %s, radius %d\n",
               obj_nameof(gp), mission_name(mission),
-              xyas(x, y, player->cnum), gp->radius);
-       } else if (mission) {
-           pr("%s on %s mission\n", obj_nameof(gp),
-              mission_name(mission));
-       }
-
-       if (mission)
+              xyas(x, y, player->cnum), radius);
            gp->mobil -= mobused;
+           gp->radius = radius;
+       } else
+           gp->radius = 0;
+
        gp->mission = mission;
        gp->opx = x;
        gp->opy = y;