/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
- * Ken Stevens, Steve McClure
+ * Copyright (C) 1986-2011, 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,
* 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/>.
*
* ---
*
*
* Known contributors to this file:
* Steve McClure, 2000
- * Markus Armbruster, 2004-2009
+ * Markus Armbruster, 2004-2011
*/
#include <config.h>
#include <ctype.h>
#include "commands.h"
-#include "empobj.h"
#include "optlist.h"
#include "unit.h"
getsect(item.gen.x, item.gen.y, §);
if (type == EF_SHIP) {
if (!player->owner
- && getrel(getnatp(sect.sct_own), player->cnum) < FRIENDLY) {
+ && relations_with(sect.sct_own, player->cnum) < FRIENDLY) {
pr("%s is not in a friendly harbor!\n",
prship(&item.ship));
continue;
prship(&item.ship));
continue;
}
- if (opt_TRADESHIPS
- && (mchr[item.ship.shp_type].m_flags & M_TRADE)) {
+ if (mchr[item.ship.shp_type].m_flags & M_TRADE) {
pr("WARNING: You only collect money from trade ships if you \"scuttle\" them!\n");
sprintf(prompt,
"Are you really sure that you want to scrap %s (n)? ",
}
} else {
if (!player->owner
- && getrel(getnatp(sect.sct_own), player->cnum) != ALLIED) {
+ && relations_with(sect.sct_own, player->cnum) != ALLIED) {
pr("%s is not in an allied sector!\n",
- obj_nameof(&item.gen));
+ unit_nameof(&item.gen));
continue;
}
if (type == EF_PLANE
}
pr("%s scrapped in %s\n",
- obj_nameof(&item.gen),
+ unit_nameof(&item.gen),
xyas(item.gen.x, item.gen.y, player->cnum));
unit_drop_cargo(&item.gen, sect.sct_own);
if (type == EF_SHIP) {