Oops on unexpected mission in pln_equip() and mission_pln_equip()
This commit is contained in:
parent
3b8ff8a92d
commit
a55f5d016f
2 changed files with 17 additions and 12 deletions
|
@ -1010,21 +1010,21 @@ mission_pln_equip(struct plist *plp, struct ichrstr *ip, int flags,
|
||||||
itype = I_NONE;
|
itype = I_NONE;
|
||||||
needed = 0;
|
needed = 0;
|
||||||
switch (mission) {
|
switch (mission) {
|
||||||
case 's':
|
case 's': /* strategic bomb */
|
||||||
case 'p':
|
case 'p': /* pinpoint bomb */
|
||||||
if (pp->pln_nuketype == -1) {
|
if (pp->pln_nuketype == -1) {
|
||||||
itype = I_SHELL;
|
itype = I_SHELL;
|
||||||
needed = load;
|
needed = load;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't': /* transport */
|
||||||
case 'd':
|
case 'd': /* drop */
|
||||||
if ((pcp->pl_flags & P_C) == 0 || ip == 0)
|
if ((pcp->pl_flags & P_C) == 0 || ip == 0)
|
||||||
break;
|
break;
|
||||||
itype = ip->i_uid;
|
itype = ip->i_uid;
|
||||||
needed = (load * 2) / ip->i_lbs;
|
needed = (load * 2) / ip->i_lbs;
|
||||||
break;
|
break;
|
||||||
case 'a':
|
case 'a': /* paradrop */
|
||||||
if ((pcp->pl_flags & (P_V | P_C)) == 0)
|
if ((pcp->pl_flags & (P_V | P_C)) == 0)
|
||||||
break;
|
break;
|
||||||
itype = I_MILIT;
|
itype = I_MILIT;
|
||||||
|
@ -1036,7 +1036,10 @@ mission_pln_equip(struct plist *plp, struct ichrstr *ip, int flags,
|
||||||
needed = load;
|
needed = load;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 0: /* plane interception */
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
|
CANT_REACH();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (itype != I_NONE && needed <= 0)
|
if (itype != I_NONE && needed <= 0)
|
||||||
|
|
|
@ -643,34 +643,36 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, char mission)
|
||||||
itype = I_NONE;
|
itype = I_NONE;
|
||||||
needed = 0;
|
needed = 0;
|
||||||
switch (mission) {
|
switch (mission) {
|
||||||
case 's':
|
case 's': /* strategic bomb */
|
||||||
case 'p':
|
case 'p': /* pinpoint bomb */
|
||||||
if (pp->pln_nuketype == -1) {
|
if (pp->pln_nuketype == -1) {
|
||||||
itype = I_SHELL;
|
itype = I_SHELL;
|
||||||
needed = load;
|
needed = load;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't': /* transport */
|
||||||
case 'd':
|
case 'd': /* drop */
|
||||||
if ((pcp->pl_flags & P_C) == 0 || ip == 0)
|
if ((pcp->pl_flags & P_C) == 0 || ip == 0)
|
||||||
break;
|
break;
|
||||||
itype = ip->i_uid;
|
itype = ip->i_uid;
|
||||||
needed = (load * 2) / ip->i_lbs;
|
needed = (load * 2) / ip->i_lbs;
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm': /* mine */
|
||||||
if ((pcp->pl_flags & P_MINE) == 0)
|
if ((pcp->pl_flags & P_MINE) == 0)
|
||||||
break;
|
break;
|
||||||
itype = I_SHELL;
|
itype = I_SHELL;
|
||||||
needed = (load * 2) / ip->i_lbs;
|
needed = (load * 2) / ip->i_lbs;
|
||||||
break;
|
break;
|
||||||
case 'a':
|
case 'a': /* paradrop */
|
||||||
if ((pcp->pl_flags & (P_V | P_C)) == 0)
|
if ((pcp->pl_flags & (P_V | P_C)) == 0)
|
||||||
break;
|
break;
|
||||||
itype = I_MILIT;
|
itype = I_MILIT;
|
||||||
needed = load / ip->i_lbs;
|
needed = load / ip->i_lbs;
|
||||||
break;
|
break;
|
||||||
default:
|
case 'r': /* reconnaissance */
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
CANT_REACH();
|
||||||
}
|
}
|
||||||
if (itype != I_NONE && needed <= 0) {
|
if (itype != I_NONE && needed <= 0) {
|
||||||
pr("%s can't contribute to mission\n", prplane(pp));
|
pr("%s can't contribute to mission\n", prplane(pp));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue