]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/shi.c
Update copyright notice
[empserver] / src / lib / commands / shi.c
index 05d8c018a28eabd4346bbdcf7693eae2ba148fb0..8aa5b385fed39ea060bb54961a6d1cf74132fe0e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
  *  ---
  *
  *  shi.c: Show a list of your ships
- * 
+ *
  *  Known contributors to this file:
  *     Steve McClure, 2000
  */
 int
 shi(void)
 {
-    int nships, noff;
+    int nships, noff, npln, nch, nxl;
     struct nstr_item ni;
     struct shpstr ship;
 
-    if (!snxtitem(&ni, EF_SHIP, player->argp[1]))
+    if (!snxtitem(&ni, EF_SHIP, player->argp[1], NULL))
        return RET_SYN;
 
     nships = noff = 0;
     while (nxtitem(&ni, &ship)) {
        if (!player->owner || ship.shp_own == 0)
            continue;
-       count_planes(&ship);
-       count_units(&ship);
        if (nships++ == 0) {
            if (player->god)
                pr("own ");
@@ -76,10 +74,9 @@ shi(void)
        pr("%4d", ship.shp_item[I_UW]);
        pr("%4d", ship.shp_item[I_FOOD]);
 
-       pr("%3d", ship.shp_nplane);
-       pr("%3d", ship.shp_nchoppers);
-       pr("%3d", ship.shp_nxlight);
-       pr("%3d", ship.shp_nland);
+       npln = shp_nplane(&ship, &nch, &nxl, NULL);
+       pr("%3d%3d%3d", npln - nch - nxl, nch, nxl);
+       pr("%3d", shp_nland(&ship));
        pr("%4d", ship.shp_mobil);
        pr("%5d\n", ship.shp_tech);
        if (ship.shp_name[0] != 0) {