(mission_pln_equip, pln_equip): Fix the previous rev.

This commit is contained in:
Markus Armbruster 2005-07-09 13:32:54 +00:00
parent c7a372c782
commit f7b444721b
2 changed files with 19 additions and 16 deletions

View file

@ -1323,13 +1323,14 @@ mission_pln_equip(struct plist *plp, struct ichrstr *ip, int flags,
if (rval < 0 || (itype != I_NONE && needed <= 0)) { if (rval < 0 || (itype != I_NONE && needed <= 0)) {
return -1; return -1;
} }
if (item[itype] < needed && (itype == I_SHELL)) if (itype != I_NONE) {
item[itype] += supply_commod(plp->plane.pln_own, if (itype == I_SHELL && item[itype] < needed)
plp->plane.pln_x, plp->plane.pln_y, item[itype] += supply_commod(plp->plane.pln_own,
I_SHELL, needed); plp->plane.pln_x,
if (item[itype] < needed) { plp->plane.pln_y,
return -1; I_SHELL, needed);
} else { if (item[itype] < needed)
return -1;
item[itype] -= needed; item[itype] -= needed;
} }
if (itype == I_SHELL && (mission == 's' || mission == 'p')) if (itype == I_SHELL && (mission == 's' || mission == 'p'))

View file

@ -645,17 +645,19 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission)
pr("%s can't contribute to mission\n", prplane(pp)); pr("%s can't contribute to mission\n", prplane(pp));
return -1; return -1;
} }
if (item != I_NONE) {
#if 0 #if 0
/* Supply is broken somewhere, so don't use it for now */ /* Supply is broken somewhere, so don't use it for now */
if (item[itype] < needed && itype == I_SHELL) if (itype == I_SHELL && item[itype] < needed)
item[itype] += supply_commod(plp->plane.pln_own, item[itype] += supply_commod(plp->plane.pln_own,
plp->plane.pln_x, plp->plane.pln_y, plp->plane.pln_x,
I_SHELL, needed); plp->plane.pln_y,
I_SHELL, needed);
#endif #endif
if (item[itype] < needed) { if (item[itype] < needed) {
pr("Not enough %s for %s\n", ichr[itype].i_name, prplane(pp)); pr("Not enough %s for %s\n", ichr[itype].i_name, prplane(pp));
return -1; return -1;
} else { }
item[itype] -= needed; item[itype] -= needed;
} }
if (itype == I_SHELL && (mission == 's' || mission == 'p')) if (itype == I_SHELL && (mission == 's' || mission == 'p'))