]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/mission.c
Update known contributors comments
[empserver] / src / lib / subs / mission.c
index 473e012dd5ce021822c435541ac58a5ead90e510..586300a0a17eeb80133598f21774ff936ec0a582 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -30,6 +30,7 @@
  *  Known contributors to this file:
  *     Ken Stevens, 1995
  *     Steve McClure, 1996-2000
+ *     Markus Armbruster, 2003-2009
  */
 
 #include <config.h>
@@ -939,11 +940,14 @@ mission_pln_equip(struct plist *plp, struct ichrstr *ip, int flags,
        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(&sect, I_SHELL, needed);
+           }
            if (item[itype] < needed)
                return -1;
            item[itype] -= needed;