]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/pdump.c
Update copyright notice
[empserver] / src / lib / commands / pdump.c
index 402cf08ddc50a9e41b681f7de38648ea9dfa6fb5..530b538667fdb0853e4b16247a30a6d1b3f1e513 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, 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 @@
  *  ---
  *
  *  pdump.c: Dump plane information
- * 
+ *
  *  Known contributors to this file:
  *     John Yockey, 1997
  *     Steve McClure, 1998
@@ -45,12 +45,13 @@ pdump(void)
     int nplanes;
     struct nstr_item np;
     struct plnstr plane;
+    struct nukstr nuke;
     int field[128];
     struct natstr *natp;
     int n, i;
     time_t now;
 
-    if (!snxtitem(&np, EF_PLANE, player->argp[1]))
+    if (!snxtitem(&np, EF_PLANE, player->argp[1], NULL))
        return RET_SYN;
     prdate();
 
@@ -228,22 +229,22 @@ pdump(void)
                pr(" %d", plane.pln_tech);
                break;
            case 8:
-               pr(" %d", plane.pln_att);
+               pr(" %d", pln_att(&plane));
                break;
            case 9:
-               pr(" %d", plane.pln_def);
+               pr(" %d", pln_def(&plane));
                break;
            case 10:
-               pr(" %d", plane.pln_acc);
+               pr(" %d", pln_acc(&plane));
                break;
            case 11:
                pr(" %d", plane.pln_range);
                break;
            case 12:
-               pr(" %d", plane.pln_range_max);
+               pr(" %d", pln_range_max(&plane));
                break;
            case 13:
-               pr(" %d", plane.pln_load);
+               pr(" %d", pln_load(&plane));
                break;
            case 14:
                pr(" %d", plchr[(int)plane.pln_type].pl_fuel);
@@ -258,24 +259,16 @@ pdump(void)
                pr(" %d", plane.pln_land);
                break;
            case 18:
-               if ((plchr[(int)plane.pln_type].pl_flags & (P_O | P_M)) ==
-                   P_O) {
-                   pr(" %c",
-                      (plane.pln_flags & PLN_LAUNCHED) ? 'Y' : 'N');
-               } else
-                   pr(" N");
+               pr(pln_is_in_orbit(&plane) ? " Y" : " N");
                break;
            case 19:
-               if ((plchr[(int)plane.pln_type].pl_flags & (P_O | P_M)) ==
-                   P_O) {
-                   pr(" %c",
-                      (plane.pln_flags & PLN_SYNCHRONOUS) ? 'Y' : 'N');
-               } else
-                   pr(" N");
+               pr(pln_is_in_orbit(&plane)
+                  && (plane.pln_flags & PLN_SYNCHRONOUS)
+                   ? " Y" : " N");
                break;
            case 20:
-               if (plane.pln_nuketype != -1) {
-                   pr(" %.5s", nchr[(int)plane.pln_nuketype].n_name);
+               if (getnuke(nuk_on_plane(&plane), &nuke)) {
+                   pr(" %.5s", nchr[nuke.nuk_type].n_name);
                    break;
                } else
                    pr(" N/A");