/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2009, 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
struct sctstr {
/* initial part must match struct empobj */
- short ef_type;
+ signed ef_type: 8;
+ unsigned sct_seqno: 12;
+ unsigned sct_generation: 12;
int sct_uid; /* equals XYOFFSET(sct_x, sct_y) */
- unsigned sct_seqno;
time_t sct_timestamp; /* Last time this sector was written to */
natid sct_own; /* owner's country num */
coord sct_x; /* x coord of sector */
coord sct_y; /* y coord of sector */
signed char sct_type; /* sector type */
+ signed char sct_effic; /* 0% to 100% */
+ signed char sct_mobil; /* mobility units */
+ unsigned char sct_off; /* Should this sector produce? */
/* end of part matching struct empobj */
- unsigned char sct_effic; /* 0% to 100% */
- short sct_mobil; /* mobility units */
unsigned char sct_loyal; /* updates until civilans "converted" */
unsigned char sct_terr; /* territory 0 id # of sector */
unsigned char sct_terr1; /* territory 1 id # of sector */
unsigned char sct_uran; /* uranium ore content */
natid sct_oldown; /* old owner of sector (for liberation) */
unsigned char sct_updated; /* Has this sect been updated? */
- unsigned char sct_off; /* Should this sector produce? */
short sct_item[I_MAX+1]; /* amount of items stored here */
short sct_del[I_MAX+1]; /* delivieries */
short sct_dist[I_MAX+1]; /* distribution thresholds */
/* sector types (must agree with order in dchr, empglb.c) */
-#define SCT_WATER 0 /* basics */
-#define SCT_MOUNT 1
-#define SCT_SANCT 2
-#define SCT_WASTE 3
-#define SCT_RURAL 4
-#define SCT_CAPIT 5
-#define SCT_URAN 6
-#define SCT_PARK 7
-#define SCT_ARMSF 8 /* industries */
-#define SCT_AMMOF 9
-#define SCT_MINE 10
-#define SCT_GMINE 11
-#define SCT_HARBR 12
-#define SCT_WAREH 13
-#define SCT_AIRPT 14
-#define SCT_AGRI 15
-#define SCT_OIL 16
-#define SCT_LIGHT 17
-#define SCT_HEAVY 18
-#define SCT_FORTR 19 /* military/scientific */
-#define SCT_TECH 20
-#define SCT_RSRCH 21
-#define SCT_NUKE 22
-#define SCT_LIBR 23
-#define SCT_HIWAY 24 /* communications */
-#define SCT_RADAR 25
-#define SCT_HEADQ 26 /* headquarters */
-#define SCT_BHEAD 27 /* Bridge head */
-#define SCT_BSPAN 28 /* Bridge span */
-#define SCT_BANK 29 /* financial */
-#define SCT_REFINE 30 /* refinery */
+#define SCT_WATER 0 /* basics */
+#define SCT_MOUNT 1
+#define SCT_SANCT 2
+#define SCT_WASTE 3
+#define SCT_RURAL 4
+#define SCT_CAPIT 5
+#define SCT_URAN 6
+#define SCT_PARK 7
+#define SCT_ARMSF 8 /* industries */
+#define SCT_AMMOF 9
+#define SCT_MINE 10
+#define SCT_GMINE 11
+#define SCT_HARBR 12
+#define SCT_WAREH 13
+#define SCT_AIRPT 14
+#define SCT_AGRI 15
+#define SCT_OIL 16
+#define SCT_LIGHT 17
+#define SCT_HEAVY 18
+#define SCT_FORTR 19 /* military/scientific */
+#define SCT_TECH 20
+#define SCT_RSRCH 21
+#define SCT_NUKE 22
+#define SCT_LIBR 23
+#define SCT_HIWAY 24 /* communications */
+#define SCT_RADAR 25
+#define SCT_HEADQ 26 /* headquarters */
+#define SCT_BHEAD 27 /* Bridge head */
+#define SCT_BSPAN 28 /* Bridge span */
+#define SCT_BANK 29 /* financial */
+#define SCT_REFINE 30 /* refinery */
#define SCT_ENLIST 31 /* enlistment center */
-#define SCT_PLAINS 32 /* plains sector */
-#define SCT_BTOWER 33 /* Bridge tower */
+#define SCT_PLAINS 32 /* plains sector */
+#define SCT_BTOWER 33 /* Bridge tower */
-#define SCT_TYPE_MAX 38
+#define SCT_TYPE_MAX 38
#define getsect(x, y, p) ef_read(EF_SECTOR, sctoff((x), (y)), (p))
#define putsect(p) ef_write(EF_SECTOR, (p)->sct_uid, (p))
#define SCT_LANDMINES(sp) \
(SCT_MINES_ARE_SEAMINES((sp)) ? 0 : (sp)->sct_mines)
-#define MOB_MOVE 0
-#define MOB_MARCH 1
-#define MOB_RAIL 2
-
-#define INT_ROAD 0
-#define INT_RAIL 1
-#define INT_DEF 2
+#define INT_ROAD 0
+#define INT_RAIL 1
+#define INT_DEF 2
/* Sector flags */
#define MOVE_IN_PROGRESS bit(0) /* move in progress */