]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/ldump.c
commands: Rename the command functions
[empserver] / src / lib / commands / ldump.c
index 78e3a2e9a181bb16d99aed1321f7aad263607ab1..1186244b196870afb8108fc85bf8f0c284d9355f 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
- *                           Ken Stevens, Steve McClure
+ *  Copyright (C) 1986-2021, 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/>.
  *
  *  ---
  *
@@ -26,7 +25,7 @@
  *  ---
  *
  *  ldump.c: Dump land unit information
- * 
+ *
  *  Known contributors to this file:
  *     John Yockey, 1997
  *     Steve McClure, 1998
 
 #include <config.h>
 
-#include "misc.h"
-#include "player.h"
-#include "xy.h"
-#include "sect.h"
-#include "land.h"
-#include "nat.h"
-#include "nsc.h"
-#include "file.h"
-#include "optlist.h"
 #include "commands.h"
+#include "land.h"
 
 int
-ldump(void)
+c_ldump(void)
 {
     int nunits;
     int field[128];
@@ -56,7 +47,7 @@ ldump(void)
     struct natstr *np;
     time_t now;
 
-    if (!snxtitem(&ni, EF_LAND, player->argp[1]))
+    if (!snxtitem(&ni, EF_LAND, player->argp[1], NULL))
        return RET_SYN;
     prdate();
     nunits = 0;
@@ -306,9 +297,6 @@ ldump(void)
            continue;
        if (!player->owner && !player->god)
            continue;
-       count_land_planes(&land);
-       lnd_count_units(&land);
-
        nunits++;
        if (player->god)
            pr("%d ", land.lnd_own);
@@ -326,7 +314,7 @@ ldump(void)
                pr(" %d", yrel(np, land.lnd_y));
                break;
            case 4:
-               pr(" %c ", land.lnd_army ? land.lnd_army : '~');
+               pr(" %c", land.lnd_army ? land.lnd_army : '~');
                break;
            case 5:
                pr(" %d", land.lnd_effic);
@@ -344,10 +332,7 @@ ldump(void)
                pr(" %d", land.lnd_item[I_FOOD]);
                break;
            case 10:
-               if (opt_FUEL)
-                   pr(" %d", land.lnd_fuel);
-               else
-                   pr(" 0");
+               pr(" 0");
                break;
            case 11:
                pr(" %d", land.lnd_tech);
@@ -356,13 +341,13 @@ ldump(void)
                pr(" %d", land.lnd_retreat);
                break;
            case 13:
-               pr(" %d", land.lnd_rad_max);
+               pr(" 0");
                break;
            case 14:
-               pr(" %d", land.lnd_nxlight);
+               pr(" %d", lnd_nxlight(&land));
                break;
            case 15:
-               pr(" %d", land.lnd_nland);
+               pr(" %d", lnd_nland(&land));
                break;
            case 16:
                pr(" %d", land.lnd_land);
@@ -401,40 +386,40 @@ ldump(void)
                pr(" %d", land.lnd_item[I_RAD]);
                break;
            case 28:
-               pr(" %1.2f", land.lnd_att);
+               pr(" %1.2f", lnd_att(&land));
                break;
            case 29:
-               pr(" %1.2f", land.lnd_def);
+               pr(" %1.2f", lnd_def(&land));
                break;
            case 30:
-               pr(" %d", land.lnd_vul);
+               pr(" %d", lnd_vul(&land));
                break;
            case 31:
-               pr(" %d", land.lnd_spd);
+               pr(" %d", lnd_spd(&land));
                break;
            case 32:
-               pr(" %d", land.lnd_vis);
+               pr(" %d", lnd_vis(&land));
                break;
            case 33:
-               pr(" %d", land.lnd_spy);
+               pr(" %d", lchr[land.lnd_type].l_spy);
                break;
            case 34:
-               pr(" %d", land.lnd_rad);
+               pr(" %d", lchr[land.lnd_type].l_rad);
                break;
            case 35:
-               pr(" %d", land.lnd_frg);
+               pr(" %d", lnd_frg(&land));
                break;
            case 36:
-               pr(" %d", land.lnd_acc);
+               pr(" %d", lnd_acc(&land));
                break;
            case 37:
-               pr(" %d", land.lnd_dam);
+               pr(" %d", lnd_dam(&land));
                break;
            case 38:
-               pr(" %d", land.lnd_ammo);
+               pr(" %d", lchr[land.lnd_type].l_ammo);
                break;
            case 39:
-               pr(" %d", land.lnd_aaf);
+               pr(" %d", lnd_aaf(&land));
                break;
            case 40:
                pr(" %d", land.lnd_item[I_UW]);