/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
*
* ---
*
- * See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- * related information and legal notices. It is expected that any future
- * projects/authors will amend these files as needed.
+ * See files README, COPYING and CREDITS in the root of the source
+ * tree for related information and legal notices. It is expected
+ * that future projects/authors will amend these files as needed.
*
* ---
*
* Steve McClure, 1998
*/
+#include <config.h>
+
#include "misc.h"
#include "player.h"
#include "plague.h"
if (!snxtitem(&tenders, EF_SHIP,
getstarg(player->argp[2], "Tender(s)? ", buf)))
return RET_SYN;
- while (nxtitem(&tenders, (s_char *)&tender)) {
+ while (nxtitem(&tenders, &tender)) {
if (!player->owner)
continue;
if ((p =
if (!check_ship_ok(&tender))
return RET_FAIL;
total = 0;
- while (tend_nxtitem(&targets, (s_char *)&target)) {
+ while (nxtitem(&targets, &target)) {
if (!player->owner)
continue;
ontarget = target.lnd_item[ip->i_vtype];
if (ontarget == 0 && amt < 0) {
pr("No %s on %s\n",
- ip->i_name, prship((struct shpstr *)&target));
+ ip->i_name, prland(&target));
continue;
}
lbase = &lchr[(int)target.lnd_type];
amt = 0;
/* take from target and give to tender */
- transfer = min(ontarget, -amt);
- transfer = min(maxtender - ontender, transfer);
+ transfer = MIN(ontarget, -amt);
+ transfer = MIN(maxtender - ontender, transfer);
if (transfer == 0)
continue;
target.lnd_item[ip->i_vtype] = ontarget - transfer;
total += transfer;
} else {
/* give to target from tender */
- transfer = min(ontender, amt);
- transfer = min(transfer, maxtarget - ontarget);
+ transfer = MIN(ontender, amt);
+ transfer = MIN(transfer, maxtarget - ontarget);
if (transfer == 0)
continue;
target.lnd_item[ip->i_vtype] = ontarget + transfer;