* Known contributors to this file:
* Ken Stevens, 1995
* Steve McClure, 1996-2000
+ * Markus Armbruster, 2003-2009
*/
#include <config.h>
if (itype != I_NONE && needed <= 0)
return -1;
if (itype != I_NONE) {
- if (itype == I_SHELL && item[itype] < needed)
- item[itype] += supply_commod(plp->plane.pln_own,
- plp->plane.pln_x,
- plp->plane.pln_y,
- I_SHELL, needed);
+ if (itype == I_SHELL && item[itype] < needed) {
+ if (pp->pln_ship >= 0)
+ shp_supply(&ship, I_SHELL, needed);
+ else if (pp->pln_land >= 0)
+ lnd_supply(&land, I_SHELL, needed);
+ else
+ sct_supply(§, I_SHELL, needed);
+ }
if (item[itype] < needed)
return -1;
item[itype] -= needed;