/*
* 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
*
* 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);
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)
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;