]> git.pond.sub.org Git - empserver/blobdiff - include/ship.h
Extend the common header of struct empobj to include uid
[empserver] / include / ship.h
index d09d8cc93a2047ae77a162a064367a78b0b0946f..cbfed235be30a681e50c7a32aaad9b93ff1a3e0a 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-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -37,6 +37,7 @@
 #ifndef SHIP_H
 #define SHIP_H
 
+#include <time.h>
 #include "item.h"
 #include "queue.h"
 #include "retreat.h"
@@ -62,8 +63,8 @@
 struct shpstr {
     /* initial part must match struct empobj */
     short ef_type;
-    natid shp_own;             /* owner's country num */
     short shp_uid;             /* unit id (ship #) */
+    natid shp_own;             /* owner's country num */
     coord shp_x;               /* x location in abs coords */
     coord shp_y;               /* y location in abs coords */
     signed char shp_type;      /* index in mchr[] */
@@ -93,7 +94,7 @@ struct shpstr {
     short shp_item[I_MAX+1];   /* amount of items on board */
     short shp_pstage;          /* plague stage */
     short shp_ptime;           /* how many etus remain in this stage */
-    time_t shp_access;         /* Last time mob was updated (MOB_ACCESS) */
+    short shp_access;          /* Last tick mob was updated (MOB_ACCESS) */
     time_t shp_timestamp;      /* Last time this ship was touched. */
     unsigned char shp_mobquota;        /* mobility quota */
     char shp_path[MAXSHPPATH];
@@ -109,27 +110,6 @@ struct shpstr {
     char shp_rpath[RET_LEN];   /* retreat path */
 };
 
-struct fltelemstr {
-    int num;
-    int own;
-    double mobil, mobcost;
-    struct fltelemstr *next;
-};
-
-struct fltheadstr {
-    int leader;
-    signed char real_q;
-/* defines for the real_q member */
-#define        LEADER_VIRTUAL  0
-#define        LEADER_REAL     1
-#define        LEADER_WRONGSECT        2
-    coord x, y;
-    natid own;
-    unsigned maxmoves;
-    struct fltelemstr *head;
-    struct fltheadstr *next;
-};
-
 struct mchrstr {
     short m_item[I_MAX+1];     /* load limit */
     int m_lcm;                 /* units of lcm to build */
@@ -170,10 +150,8 @@ struct mchrstr {
 #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 */
-/* M_XLIGHT will be automatically set in init_mchr() if m_nxlight > 0 */
-#define        M_XLIGHT        bit(15) /* can hold xlight planes */
-/* M_CHOPPER will be automatically set in init_mchr() if m_nchoppers > 0 */
-#define M_CHOPPER      bit(16) /* can hold choppers */
+/* unused              bit(15) */
+/* unused              bit(16) */
 #define M_OILER                bit(17) /* can re-fuel ships */
 #define M_SUPPLY       bit(18) /* Can supply units/sects/ships */
 #define M_CANAL                bit(19) /* Can navigate a canal (BIG CITY) */
@@ -181,7 +159,7 @@ struct mchrstr {
 
 #define getship(n, p) ef_read(EF_SHIP, (n), (p))
 #define putship(n, p) ef_write(EF_SHIP, (n), (p))
-#define getshipp(n) (struct shpstr *)ef_ptr(EF_SHIP, (n))
+#define getshipp(n) ((struct shpstr *)ef_ptr(EF_SHIP, (n)))
 
 extern struct mchrstr mchr[SHP_TYPE_MAX + 2];