]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/fly.c
Update copyright notice
[empserver] / src / lib / commands / fly.c
index efc60696fd4a34e2519050d54fcb095fa27d488b..5351d25d969aeee90d032b55318827fb6e0d2985 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -30,7 +30,7 @@
  *  Known contributors to this file:
  *     Dave Pare, 1986
  *     Steve McClure, 2000
- *     Markus Armbruster, 2004-2008
+ *     Markus Armbruster, 2004-2009
  */
 
 #include <config.h>
@@ -66,7 +66,7 @@ fly(void)
        return RET_SYN;
     ax = ap_sect.sct_x;
     ay = ap_sect.sct_y;
-    if (getpath(flightpath, player->argp[4], ax, ay, 0, 0, P_FLYING) == 0
+    if (!getpath(flightpath, player->argp[4], ax, ay, 0, 0, P_FLYING)
        || *flightpath == 0)
        return RET_SYN;
     tx = ax;
@@ -94,16 +94,10 @@ fly(void)
     /*
      * select planes within range
      */
-    pln_sel(&ni_bomb, &bomb_list, &ap_sect, ap_to_target,
-           1, wantflags, P_M | P_O);
-    if (QEMPTY(&bomb_list)) {
-       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);
+    pln_sel(&ni_bomb, &bomb_list, &ap_sect, ap_to_target, 1,
+           wantflags, P_M | P_O);
+    pln_sel(&ni_esc, &esc_list, &ap_sect, ap_to_target, 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;
@@ -111,14 +105,13 @@ fly(void)
     /*
      * now arm and equip the bombers, transports, whatever.
      */
-    pln_arm(&bomb_list, ap_to_target, 't', ip, 0);
+    pln_arm(&bomb_list, ap_to_target, 't', ip);
     if (QEMPTY(&bomb_list)) {
        pr("No planes could be equipped for the mission.\n");
        return RET_FAIL;
     }
-    pln_arm(&esc_list, ap_to_target, 't', ip, P_ESC | P_F);
-    ac_encounter(&bomb_list, &esc_list, ax, ay,
-                flightpath, 0, 0);
+    pln_arm(&esc_list, ap_to_target, 'e', NULL);
+    ac_encounter(&bomb_list, &esc_list, ax, ay, flightpath, 0);
     if (QEMPTY(&bomb_list)) {
        pr("No planes got through fighter defenses\n");
     } else {