Simplify calling of pln_arm() & friends

pln_arm(), pln_equip(), mission_pln_arm() mission_pln_equip() took a
mission parameter encoding the kind of sortie (strategic bomb,
pinpoint bomb, transport, ...), a flag parameter to further specify
the plane's role, and a parameter ip to specify the load.

The flags argument was always either P_F (intercept), P_F | P_ESC
(escort), or zero (any other role).

With non-zero flags, mission and ip argument were not used in any way.

Use mission 'e' and null load for escorts, and remove flags.
Intercept can still be identified by mission zero.

Also change pln_mobcost() to take a mission parameter instead of
flags, so that pln_arm() and mission_pln_arm() can simply pass on
their mission.
This commit is contained in:
Markus Armbruster 2009-09-13 21:35:17 -04:00
parent b1dd82fa61
commit 0fe43096bc
10 changed files with 147 additions and 152 deletions

View file

@ -97,12 +97,12 @@ reco(void)
/*
* now arm and equip the bombers, transports, whatever.
*/
pln_arm(&bomb_list, ap_to_target, 'r', NULL, 0);
pln_arm(&bomb_list, ap_to_target, 'r', NULL);
if (QEMPTY(&bomb_list)) {
pr("No planes could be equipped for the mission.\n");
return RET_FAIL;
}
pln_arm(&esc_list, ap_to_target, 'r', NULL, P_F | P_ESC);
pln_arm(&esc_list, ap_to_target, 'e', NULL);
ac_encounter(&bomb_list, &esc_list, ax, ay, flightpath,
*player->argp[0] == 's' ? PM_R | PM_S : PM_R);
if (QEMPTY(&bomb_list)) {