]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/lten.c
Update copyright notice
[empserver] / src / lib / commands / lten.c
index f51469802017533bc7af7a1c0a58145aba101451..ae1ab8a3d5383d2f0485b845b73032611207a034 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
- *                           Ken Stevens, Steve McClure
+ *  Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *                Ken Stevens, Steve McClure, Markus Armbruster
  *
- *  This program is free software; you can redistribute it and/or modify
+ *  Empire is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
+ *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  *  ---
  *
@@ -27,7 +26,7 @@
  *
  *  lten.c: Transfer commodity from a ship to a land unit the ship is
  *          carrying
- * 
+ *
  *  Known contributors to this file:
  *     Dave Pare, 1986
  *     Thomas Ruschak
@@ -41,7 +40,6 @@
 #include "item.h"
 #include "land.h"
 #include "plague.h"
-#include "plane.h"
 #include "ship.h"
 
 static void expose_land(struct shpstr *s1, struct lndstr *l1);
@@ -69,15 +67,13 @@ ltend(void)
     if (!(ip = whatitem(player->argp[1], "Transfer what commodity? ")))
        return RET_SYN;
 
-    if (!snxtitem(&tenders, EF_SHIP,
-                 getstarg(player->argp[2], "Tender(s)? ", buf)))
+    if (!snxtitem(&tenders, EF_SHIP, player->argp[2], "Tender(s)? "))
        return RET_SYN;
     while (nxtitem(&tenders, &tender)) {
        if (!player->owner)
            continue;
-       if ((p =
-            getstarg(player->argp[3], "Amount to transfer? ", buf)) == 0)
-           break;
+       if (!(p = getstarg(player->argp[3], "Amount to transfer? ", buf)))
+           return RET_FAIL;
        if (!check_ship_ok(&tender))
            return RET_FAIL;
        if ((amt = atoi(p)) == 0)
@@ -92,12 +88,11 @@ ltend(void)
        if (maxtender == 0) {
            pr("A %s cannot hold any %s\n",
               mchr[(int)tender.shp_type].m_name, ip->i_name);
-           break;
+           return RET_FAIL;
        }
        if (!snxtitem(&targets, EF_LAND,
-                     getstarg(player->argp[4], "Units to be tended? ",
-                              buf)))
-           break;
+                     player->argp[4], "Units to be tended? "))
+           return RET_FAIL;
        if (!check_ship_ok(&tender))
            return RET_FAIL;
        total = 0;
@@ -109,8 +104,7 @@ ltend(void)
                continue;
            ontarget = target.lnd_item[ip->i_uid];
            if (ontarget == 0 && amt < 0) {
-               pr("No %s on %s\n",
-                  ip->i_name, prland(&target));
+               pr("No %s on %s\n", ip->i_name, prland(&target));
                continue;
            }
            lbase = &lchr[(int)target.lnd_type];