]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/lten.c
Update copyright notice
[empserver] / src / lib / commands / lten.c
index 7e338e17cd61a7ccd4c7f516d1bf3930eee7ee67..5791265d2b7956c5d7e0fd00274eb31a027aad62 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -27,7 +27,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
 
 #include <config.h>
 
-#include "misc.h"
-#include "player.h"
-#include "plague.h"
-#include "file.h"
-#include "ship.h"
+#include "commands.h"
 #include "item.h"
-#include "nsc.h"
-#include "plane.h"
 #include "land.h"
-#include "commands.h"
+#include "plague.h"
+#include "plane.h"
+#include "ship.h"
 
 static void expose_land(struct shpstr *s1, struct lndstr *l1);
 
@@ -67,21 +63,19 @@ ltend(void)
     int maxtarget;
     int transfer;
     int total;
-    s_char *p;
-    s_char buf[1024];
+    char *p;
+    char buf[1024];
 
     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)
@@ -96,12 +90,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;