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:
parent
5f5362cece
commit
fd4da5aab3
2 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue