Store uids as int to support more sectors and units

Before, they were stored as short.  Wider uids use more space, but the
next commit will recover it by narrowing other members.

The use of short has always limited the number of ships, planes, land
units and nukes to SHRT_MAX (commonly 32768).  Only the most extreme
games ever came close.

Commit 49780e2c (v4.3.12) added struct sctstr member sct_uid to make
struct empobj member uid work for sectors.  This made the limit apply
to sectors as well.  We've had games with more than 32768 sectors.
This commit is contained in:
Markus Armbruster 2009-12-30 14:07:51 +01:00
parent 18148f03fa
commit ba2044be18
18 changed files with 50 additions and 50 deletions

View file

@ -50,7 +50,7 @@
struct lndstr {
/* initial part must match struct empobj */
short ef_type;
short lnd_uid; /* unit id (land unit) */
int lnd_uid; /* unit id (land #) */
unsigned lnd_seqno;
time_t lnd_timestamp; /* Last time this unit was touched */
natid lnd_own; /* owner's country num */
@ -66,7 +66,7 @@ struct lndstr {
short lnd_mission; /* mission code */
short lnd_radius; /* mission radius */
/* end of part matching struct empobj */
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? */
@ -75,7 +75,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) */
};