]> git.pond.sub.org Git - empserver/blobdiff - include/land.h
Generation numbers to catch write back of stale copies
[empserver] / include / land.h
index 9f4b617a5d3c4fc8dd504c3e0111efe6540c38f5..d3c174a046e4c443e61a56db5a9ca79de8c20cb9 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
@@ -31,7 +31,7 @@
  *     Thomas Ruschak, 1992
  *     Ken Stevens, 1995
  *     Steve McClure, 1998
- *     Markus Armbruster, 2004-2008
+ *     Markus Armbruster, 2004-2009
  */
 
 #ifndef LAND_H
 
 struct lndstr {
     /* initial part must match struct empobj */
-    short ef_type;
-    short lnd_uid;             /* unit id (land unit) */
-    unsigned lnd_seqno;
+    signed ef_type: 8;
+    unsigned lnd_seqno: 12;
+    unsigned lnd_generation: 12;
+    int lnd_uid;               /* unit id (land #) */
     time_t lnd_timestamp;      /* Last time this unit was touched */
     natid lnd_own;             /* owner's country num */
     coord lnd_x;               /* x location in abs coords */
@@ -66,8 +67,7 @@ struct lndstr {
     short lnd_mission;         /* mission code */
     short lnd_radius;          /* mission radius */
     /* end of part matching struct empobj */
-    signed char lnd_flags;     /* unit flags (unused) */
-    short lnd_ship;            /* pointer to transporting ship */
+    int lnd_ship;              /* uid of transporting ship, or -1 */
     signed char lnd_harden;    /* fortification */
     short lnd_retreat;         /* retreat percentage */
     int lnd_rflags;            /* When do I retreat? */
@@ -76,7 +76,7 @@ struct lndstr {
     short lnd_item[I_MAX+1];   /* amount of items on board */
     short lnd_pstage;          /* plague stage */
     short lnd_ptime;           /* how many etus remain in this stage */
-    short lnd_land;            /* pointer to transporting unit */
+    int lnd_land;              /* uid of transporting land unit, or -1 */
     short lnd_access;          /* Last tick mob was updated (MOB_ACCESS) */
 };
 
@@ -165,6 +165,7 @@ extern int lnd_nxlight(struct lndstr *);
 extern int lnd_nland(struct lndstr *);
 
 extern int lnd_fire(struct lndstr *);
+extern int lnd_sabo(struct lndstr *, short *);
 extern double lnd_fire_range(struct lndstr *);
 
 /* src/lib/subs/lndsub.c */