]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/reso.c
Update copyright notice.
[empserver] / src / lib / commands / reso.c
index 48ec36854ada4865a508d1dcad218bc872988ea7..4139ac0007df1e347aead4a72cee620232e72aaf 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-2007, 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.
  *
  *  ---
  *
  *     Dave Pare, 1989
  */
 
-#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 <config.h>
+
 #include "commands.h"
+#include "path.h"
 
-static void reso_hdr(void);
+static void reso_hdr(void);
 
 int
 reso(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)
-                       reso_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(" %4d", sect.sct_min);
-               pr("%5d", sect.sct_gmin);
-               pr("%5d", sect.sct_fertil);
-               pr("%4d", sect.sct_oil);
-               pr("%5d", sect.sct_uran);
+    if (!snxtsct(&nstr, player->argp[1]))
+       return RET_SYN;
+    prdate();
+    nsect = 0;
+    while (nxtsct(&nstr, &sect)) {
+       if (!player->owner)
+           continue;
+       if (nsect++ == 0)
+           reso_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(" %4d", sect.sct_min);
+       pr("%5d", sect.sct_gmin);
+       pr("%5d", sect.sct_fertil);
+       pr("%4d", sect.sct_oil);
+       pr("%5d", sect.sct_uran);
 /*             pr("%5d", sect.sct_elev);*/
-               if (!player->god && sect.sct_terr)
-                       pr("%4d", sect.sct_terr);
-               pr("\n");
-       }
-       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 (!player->god && sect.sct_terr)
+           pr("%4d", sect.sct_terr);
+       pr("\n");
+    }
+    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
 reso_hdr(void)
 {
-       if (player->god)
-               pr("    ");
-       pr("RESOURCE\n");
-       if (player->god)
-               pr("own ");
-       pr("  sect        eff  min gold fert oil uran ");
-       if (!player->god)
-               pr("ter");
-       pr("\n");
+    if (player->god)
+       pr("    ");
+    pr("RESOURCE\n");
+    if (player->god)
+       pr("own ");
+    pr("  sect        eff  min gold fert oil uran ");
+    if (!player->god)
+       pr("ter");
+    pr("\n");
 }