Make bomb require capability bomber or tactical

Before, bomb selected any plane, but planes with zero load could not
be equipped.  Cargo planes could be equipped fine, and they flew bombs
to the target, where they silently vanished.

Closes#1388263.
This commit is contained in:
Markus Armbruster 2009-09-27 14:44:39 -04:00
parent 5f5362cece
commit fd4da5aab3
2 changed files with 8 additions and 1 deletions

View file

@ -127,7 +127,7 @@ bomb(void)
* select planes within range
*/
pln_sel(&ni_bomb, &bomb_list, &ap_sect, ap_to_target,
2, 0, P_M | P_O);
2, P_B | P_T, P_M | P_O);
pln_sel(&ni_esc, &esc_list, &ap_sect, ap_to_target,
2, P_ESC | P_F, P_M | P_O);
/*

View file

@ -360,6 +360,7 @@ pln_mine(struct emp_qelem *list, coord tx, coord ty)
/*
* Has PP's type capabilities satisfying WANTFLAGS and NOWANTFLAGS?
* A plane type is capable unless
* - it lacks all of the P_B, P_T in WANTFLAGS, or
* - it lacks all of the P_F, P_ESC in WANTFLAGS, or
* - it lacks all of the P_E, P_L, P_K in WANTFLAGS, or
* - it lacks any of the other capabilities in WANTFLAGS, or
@ -370,6 +371,12 @@ pln_capable(struct plnstr *pp, int wantflags, int nowantflags)
{
int flags = plchr[(int)pp->pln_type].pl_flags;
if (wantflags & (P_B | P_T)) {
if ((flags & wantflags & (P_B | P_T)) == 0)
return 0;
wantflags &= ~(P_B | P_T);
}
if (wantflags & (P_F | P_ESC)) {
if ((flags & wantflags & (P_F | P_ESC)) == 0)
return 0;