/*
* 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
* Known contributors to this file:
* Dave Pare, 1986
* Steve McClure, 2000
- * Markus Armbruster, 2004-2008
+ * Markus Armbruster, 2004-2009
*/
#include <config.h>
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;
/*
* 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;
/*
* 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 {