]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/scra.c
Remove option TRADESHIPS, customize table ship-chr instead
[empserver] / src / lib / commands / scra.c
index 1528873aa07987a4ef8eb951df3209f21bf27e30..d3e4eac42aef354a1cf0a9dd4d6590d5b222a551 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  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,
@@ -14,8 +14,7 @@
  *  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"
 
@@ -135,7 +133,7 @@ scra(void)
        getsect(item.gen.x, item.gen.y, &sect);
        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;
@@ -145,8 +143,7 @@ scra(void)
                   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)? ",
@@ -158,9 +155,9 @@ scra(void)
            }
        } 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
@@ -172,7 +169,7 @@ scra(void)
        }
 
        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) {