]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/stop.c
COPYING duplicates information from README. Remove. Move GPL from
[empserver] / src / lib / commands / stop.c
index 4e47322f350dcf9e1a030a2f93b2cec80799dadb..d3cddced05ad6b0a7ad06328ac56bc932f9c08e2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2000, 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
@@ -19,9 +19,9 @@
  *
  *  ---
  *
- *  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 "var.h"
 #include "xy.h"
 #include "sect.h"
 #include "nsc.h"
 #include "nat.h"
-#include "deity.h"
 #include "path.h"
 #include "file.h"
-#include "product.h"
 #include "commands.h"
 
 static void stop_hdr(void);
@@ -50,53 +49,53 @@ static void stop_hdr(void);
 int
 stop(void)
 {
-       struct  sctstr sect;
-       int     nsect;
-       struct  nstr_sect nstr;
+    struct sctstr sect;
+    int nsect;
+    struct nstr_sect nstr;
 
-       if (!snxtsct(&nstr, player->argp[1]))
-               return RET_SYN;
-       prdate();
-       nsect = 0;
-       while (nxtsct(&nstr, &sect)) {
-               if (!player->owner)
-                       continue;
-               if (nsect++ == 0)
-                       stop_hdr();
-               if (player->god)
-                       pr("%3d ", sect.sct_own);
-               prxy("%4d,%-4d", nstr.x, nstr.y, player->cnum);
-               pr(" %c", dchr[sect.sct_type].d_mnem);
-               if (sect.sct_newtype != sect.sct_type)
-                       pr("%c", dchr[sect.sct_newtype].d_mnem);
-               else
-                       pr(" ");
-               pr("%4d%%", sect.sct_effic);
+    if (!snxtsct(&nstr, player->argp[1]))
+       return RET_SYN;
+    prdate();
+    nsect = 0;
+    while (nxtsct(&nstr, &sect)) {
+       if (!player->owner)
+           continue;
+       if (nsect++ == 0)
+           stop_hdr();
+       if (player->god)
+           pr("%3d ", sect.sct_own);
+       prxy("%4d,%-4d", nstr.x, nstr.y, player->cnum);
+       pr(" %c", dchr[sect.sct_type].d_mnem);
+       if (sect.sct_newtype != sect.sct_type)
+           pr("%c", dchr[sect.sct_newtype].d_mnem);
+       else
+           pr(" ");
+       pr("%4d%%", sect.sct_effic);
 
-               pr(" will not produce or gain efficiency.\n");
-               if (sect.sct_off != 1) {
-                 sect.sct_off = 1;
-                 putsect(&sect);
-               }
+       pr(" will not produce or gain efficiency.\n");
+       if (sect.sct_off != 1) {
+           sect.sct_off = 1;
+           putsect(&sect);
        }
-       if (nsect == 0) {
-               if (player->argp[1])
-                       pr("%s: No sector(s)\n", player->argp[1]);
-               else
-                       pr("%s: No sector(s)\n", "");
-               return RET_FAIL;
-       }else
-               pr("%d sector%s\n", nsect, splur(nsect));
-       return 0;
+    }
+    if (nsect == 0) {
+       if (player->argp[1])
+           pr("%s: No sector(s)\n", player->argp[1]);
+       else
+           pr("%s: No sector(s)\n", "");
+       return RET_FAIL;
+    } else
+       pr("%d sector%s\n", nsect, splur(nsect));
+    return 0;
 }
 
 static void
 stop_hdr(void)
 {
-       if (player->god)
-               pr("    ");
-       pr("PRODUCTION STOPPAGE\n");
-       if (player->god)
-               pr("own ");
-       pr("  sect        eff\n");
+    if (player->god)
+       pr("    ");
+    pr("PRODUCTION STOPPAGE\n");
+    if (player->god)
+       pr("own ");
+    pr("  sect        eff\n");
 }