/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2012, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
* David Sharnoff, 1987
* Ken Stevens, 1995 (rewritten)
* Steve McClure, 1998-2000
- * Markus Armbruster, 2004-2012
+ * Markus Armbruster, 2004-2014
*/
#include <config.h>
continue;
if (load_unload == LOAD) {
if (noisy)
- pr("You don't own %s \n",
+ pr("You don't own %s\n",
xyas(sect.sct_x, sect.sct_y, player->cnum));
continue;
}
move_amt = -amount - unit_amt;
else
move_amt = load_unload == LOAD ? amount : -amount;
- if (move_amt > unit_max - unit_amt)
- move_amt = unit_max - unit_amt;
- if (move_amt < -unit_amt)
- move_amt = -unit_amt;
- if (move_amt > sect_amt)
- move_amt = sect_amt;
- if (move_amt < sect_amt - ITEM_MAX)
- move_amt = sect_amt - ITEM_MAX;
+ move_amt = LIMIT_TO(move_amt, -unit_amt, unit_max - unit_amt);
+ move_amt = LIMIT_TO(move_amt, sect_amt - ITEM_MAX, sect_amt);
return move_amt;
}
-static int
+int
load_comm_ok(struct sctstr *sectp, natid unit_own,
i_type item, int move_amt)
{
load_unload, atoi(p));
if (!load_comm_ok(sectp, sp->shp_own, item, move_amt))
return RET_OK;
- if (!want_to_abandon(sectp, item, move_amt, NULL))
+ if (!abandon_askyn(sectp, item, move_amt, NULL))
return RET_FAIL;
if (!still_ok_ship(sectp, sp))
return RET_SYN;