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:
parent
18148f03fa
commit
ba2044be18
18 changed files with 50 additions and 50 deletions
|
@ -47,7 +47,7 @@
|
|||
struct plnstr {
|
||||
/* initial part must match struct empobj */
|
||||
short ef_type;
|
||||
short pln_uid; /* plane unit id */
|
||||
int pln_uid; /* unit id (plane #) */
|
||||
unsigned pln_seqno;
|
||||
time_t pln_timestamp; /* Last time this plane was touched */
|
||||
natid pln_own; /* owning country */
|
||||
|
@ -65,8 +65,8 @@ struct plnstr {
|
|||
short pln_radius; /* mission radius */
|
||||
/* end of part matching struct empobj */
|
||||
unsigned char pln_range; /* total distance, not radius */
|
||||
short pln_ship; /* pointer to carrier */
|
||||
short pln_land; /* pointer to carrier */
|
||||
int pln_ship; /* uid of carrier, or -1 */
|
||||
int pln_land; /* uid of transporting land unit, or -1 */
|
||||
signed char pln_harden; /* for missiles */
|
||||
signed char pln_flags; /* State of the plane */
|
||||
short pln_access; /* Last tick mob was updated (MOB_ACCESS) */
|
||||
|
@ -136,7 +136,7 @@ struct plist {
|
|||
extern struct plchrstr plchr[PLN_TYPE_MAX + 2];
|
||||
|
||||
struct shiplist {
|
||||
short uid;
|
||||
int uid;
|
||||
struct shiplist *next;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue