]> git.pond.sub.org Git - empserver/blobdiff - include/ship.h
Update copyright notice
[empserver] / include / ship.h
index bc92699d4c72b244d1a107d7006f349d14356357..1d9d339be8208c26ad9f0414e663aeef9274d0db 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
- *                           Ken Stevens, Steve McClure
+ *  Copyright (C) 1986-2014, 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/>.
  *
  *  ---
  *
@@ -32,7 +31,7 @@
  *     Thomas Ruschak, 1992
  *     Ken Stevens, 1995
  *     Steve McClure, 1998
- *     Markus Armbruster, 2004-2009
+ *     Markus Armbruster, 2004-2013
  */
 
 #ifndef SHIP_H
 
 #include <time.h>
 #include "item.h"
-#include "queue.h"
 #include "retreat.h"
 #include "types.h"
 
 #define SHP_TYPE_MAX   46
-#define        SHIP_MINEFF     20
+#define SHIP_MINEFF    20
 
 /* bit masks for the autonav mode flags */
 
 
 
 #define MAXSHPPATH     28
-#define        MAXSHPNAMLEN    24
+#define MAXSHPNAMLEN   24
 
 struct shpstr {
     /* initial part must match struct empobj */
-    short ef_type;
-    short shp_uid;             /* unit id (ship #) */
-    unsigned shp_seqno;
+    signed ef_type: 8;
+    unsigned shp_seqno: 12;
+    unsigned shp_generation: 12;
+    int shp_uid;               /* unit it (ship #) */
     time_t shp_timestamp;      /* Last time this ship was touched. */
     natid shp_own;             /* owner's country num */
     coord shp_x;               /* x location in abs coords */
@@ -93,7 +92,7 @@ struct shpstr {
     short shp_access;          /* Last tick mob was updated (MOB_ACCESS) */
     unsigned char shp_mobquota;        /* mobility quota */
     char shp_path[MAXSHPPATH];
-    short shp_follow;
+    int shp_follow;
     char shp_name[MAXSHPNAMLEN]; /* name set with the "name" command */
     coord shp_orig_x;
     coord shp_orig_y;          /* Where we were built */
@@ -117,7 +116,7 @@ struct mchrstr {
     char *m_name;              /* full name of type of ship */
     int m_tech;                        /* tech required to build */
     int m_cost;                        /* how much it costs to build */
-    long m_flags;              /* what special things can this ship do */
+    int m_flags;               /* what special things can this ship do */
     unsigned char m_nplanes;   /* maximum number of planes this ship holds */
     unsigned char m_nland;     /* maximum number of units this ship holds */
     signed char m_type;                /* index in mchr[] */
@@ -135,17 +134,17 @@ struct mchrstr {
 #define M_MINE         bit(7)  /* drop mines */
 #define M_SWEEP                bit(8)  /* clean up the mines */
 #define M_SUB          bit(9)  /* a submarine */
-/* unused              bit(10) */
+/* unused              bit(10) */
 #define M_LAND         bit(11) /* allows full landing ability */
 #define M_SUBT         bit(12) /* allows torping of other subs */
 #define M_TRADE                bit(13) /* is a trade ship */
 #define M_SEMILAND     bit(14) /* can land 1/4 */
-/* unused              bit(15) */
-/* unused              bit(16) */
-/* unused              bit(17) */
+/* unused              bit(15) */
+/* unused              bit(16) */
+/* unused              bit(17) */
 #define M_SUPPLY       bit(18) /* Can supply units/sects/ships */
-#define M_CANAL                bit(19) /* Can navigate a canal (BIG CITY) */
-#define M_ANTIMISSILE   bit(20)        /* Shoot down missile */
+#define M_CANAL                bit(19) /* Can navigate a canal (BIG CITY) */
+#define M_ANTIMISSILE  bit(20) /* Shoot down missile */
 
 #define getship(n, p) ef_read(EF_SHIP, (n), (p))
 #define putship(n, p) ef_write(EF_SHIP, (n), (p))