]> git.pond.sub.org Git - empserver/blobdiff - include/ship.h
Generation numbers to catch write back of stale copies
[empserver] / include / ship.h
index 20fa311db53141e10a96c1c72291636a7f5d0122..a8762d5783ffcd20b72a0916494c991d260c030d 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-2009, 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 @@
  *  ---
  *
  *  ship.h: Definitions for things having to do with ships
- * 
+ *
  *  Known contributors to this file:
  *     Dave Pare
  *     Thomas Ruschak, 1992
@@ -66,6 +66,7 @@ struct shpstr {
     short ef_type;
     short shp_uid;             /* unit id (ship #) */
     unsigned shp_seqno;
+    unsigned shp_generation;
     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 */
@@ -80,8 +81,6 @@ struct shpstr {
     short shp_mission;         /* mission code */
     short shp_radius;          /* mission radius */
     /* end of part matching struct empobj */
-    unsigned char shp_nplane;  /* number of planes on board */
-    unsigned char shp_nland;   /* number of land units on board */
     coord shp_destx[2];                /* location for ship destination */
     coord shp_desty[2];
     i_type shp_tstart[TMAX];   /* what goods to pick up at start point */
@@ -97,8 +96,6 @@ struct shpstr {
     char shp_path[MAXSHPPATH];
     short shp_follow;
     char shp_name[MAXSHPNAMLEN]; /* name set with the "name" command */
-    unsigned char shp_nchoppers; /* How many choppers on board? */
-    unsigned char shp_nxlight; /* How many xlight planes on board? */
     coord shp_orig_x;
     coord shp_orig_y;          /* Where we were built */
     natid shp_orig_own;                /* Who built us */
@@ -182,6 +179,9 @@ extern int shp_visib(struct shpstr *);
 extern int shp_frnge(struct shpstr *);
 extern int shp_glim(struct shpstr *);
 
+extern int shp_nplane(struct shpstr *, int *, int *, int *);
+extern int shp_nland(struct shpstr *);
+
 extern int shp_dchrg(struct shpstr *);
 extern int shp_fire(struct shpstr *);
 extern int shp_torp(struct shpstr *, int);