]> git.pond.sub.org Git - empserver/commitdiff
Simplify wantflags calculation in bomb(), fly(), para(), reco()
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Sep 2009 15:10:08 +0000 (11:10 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 8 Dec 2009 07:15:51 +0000 (08:15 +0100)
src/lib/commands/bomb.c
src/lib/commands/fly.c
src/lib/commands/para.c
src/lib/commands/reco.c

index 4179ea328bf570ecd7a8e2e71036a7aadb7ffe9a..5be840b24d1406b6c119910495fdf8b01bd607b5 100644 (file)
@@ -91,7 +91,6 @@ bomb(void)
     struct sctstr target;
     struct emp_qelem bomb_list;
     struct emp_qelem esc_list;
-    int wantflags;
     struct sctstr ap_sect;
     char mission;
     struct plist *plp;
@@ -100,7 +99,6 @@ bomb(void)
     struct natstr *natp;
     char buf[1024];
 
-    wantflags = 0;
     if (get_planes(&ni_bomb, &ni_esc, player->argp[1], player->argp[2]) < 0)
        return RET_SYN;
     p = getstarg(player->argp[3], "pinpoint, or strategic? ", buf);
@@ -129,9 +127,9 @@ bomb(void)
      * select planes within range
      */
     pln_sel(&ni_bomb, &bomb_list, &ap_sect, ap_to_target,
-           2, wantflags, P_M | P_O);
+           2, 0, P_M | P_O);
     pln_sel(&ni_esc, &esc_list, &ap_sect, ap_to_target,
-           2, wantflags | P_F | P_ESC, P_M | P_O);
+           2, P_ESC | P_F, P_M | P_O);
     /*
      * now arm and equip the bombers, transports, whatever.
      */
index 4a9bb91bf79e5c9c24fb1b283385804723835873..297b389825606c9bf586da04b30cb3c281f575ce 100644 (file)
@@ -100,10 +100,8 @@ fly(void)
        pr("No planes could be equipped for the mission.\n");
        return RET_FAIL;
     }
-    wantflags |= P_F;
-    wantflags |= P_ESC;
     pln_sel(&ni_esc, &esc_list, &ap_sect, ap_to_target,
-           1, wantflags, P_M | P_O);
+           1, wantflags | P_ESC | P_F, P_M | P_O);
     if (cno >= 0 && !pln_oneway_to_carrier_ok(&bomb_list, &esc_list, cno)) {
        pr("Not enough room on ship #%d!\n", cno);
        return RET_FAIL;
index b32a9de84df45874b2e9b575e724d319e8f6a7e2..10720cc3aadb915383dadc73a16db39c94c54b96 100644 (file)
@@ -57,11 +57,9 @@ para(void)
     struct sctstr target;
     struct emp_qelem bomb_list;
     struct emp_qelem esc_list;
-    int wantflags;
     struct sctstr ap_sect;
     char buf[1024];
 
-    wantflags = P_P;
     if (get_planes(&ni_bomb, &ni_esc, player->argp[1], player->argp[2]) < 0)
        return RET_SYN;
     if (!get_assembly_point(player->argp[3], &ap_sect, buf))
@@ -84,7 +82,7 @@ para(void)
      * select planes within range
      */
     pln_sel(&ni_bomb, &bomb_list, &ap_sect, ap_to_target,
-           2, P_C | wantflags, P_M | P_O);
+           2, P_P | P_C, P_M | P_O);
     pln_sel(&ni_esc, &esc_list, &ap_sect, ap_to_target,
            2, P_ESC | P_F, P_M | P_O);
     /*
index b0a6f457e665aa4529e2fe9686a13e7089028d2d..18981d936d827a8b72fc427e1b4e72d7e2baf92f 100644 (file)
@@ -86,10 +86,8 @@ reco(void)
        pr("No planes could be equipped for the mission.\n");
        return RET_FAIL;
     }
-    wantflags |= P_F;
-    wantflags |= P_ESC;
     pln_sel(&ni_esc, &esc_list, &ap_sect, ap_to_target,
-           1, wantflags, P_M | P_O);
+           1, wantflags | P_ESC | P_F, P_M | P_O);
     if (cno >= 0 && !pln_oneway_to_carrier_ok(&bomb_list, &esc_list, cno)) {
        pr("Not enough room on ship #%d!\n", cno);
        return RET_FAIL;