struct comstr {
/* initial part must match struct empobj */
short ef_type;
- natid com_owner;
short com_uid;
+ natid com_owner;
/* end of part matching struct empobj */
i_type com_type;
int com_amount;
struct empobj {
short ef_type; /* is always valid */
- natid own; /* is valid if EFF_OWNER is set in table def. */
short uid;
+ natid own; /* is valid if EFF_OWNER is set in table def. */
coord x; /* is valid if EFF_XY is set in table def. */
coord y; /* is valid if EFF_XY is set in table def. */
signed char type; /* is valid for sectors and units */
struct gamestr {
/* initial part must match struct empobj */
short ef_type;
+ short game_uid;
/* end of part matching struct empobj */
char game_upd_disable; /* updates disabled? */
/*
struct lndstr {
/* initial part must match struct empobj */
short ef_type;
- natid lnd_own; /* owner's country num */
short lnd_uid; /* unit id (land unit) */
+ natid lnd_own; /* owner's country num */
coord lnd_x; /* x location in abs coords */
coord lnd_y; /* y location in abs coords */
signed char lnd_type; /* index in lchr[] */
#define SECS_PER_DAY (60*60*24)
struct lonstr {
+ /* initial part must match struct empobj */
short ef_type;
- natid l_loner; /* loan shark */
short l_uid;
+ /* end of part matching struct empobj */
+ natid l_loner; /* loan shark */
natid l_lonee; /* sucker */
signed char l_status; /* loan status */
short l_sell; /* pointer to trade file (unused) */
struct loststr {
/* initial part must match struct empobj */
short ef_type;
+ int lost_uid; /* lost ID (assigned, otherwise unused) */
natid lost_owner; /* Who lost it */
/* end of part matching struct empobj */
- int lost_uid; /* lost ID (assigned, otherwise unused) */
short lost_type; /* Type of thing (ship, plane, nuke, land, sector) */
short lost_id; /* ID of lost thing */
coord lost_x;
struct realmstr {
/* initial part must match struct empobj */
short ef_type;
+ short r_uid; /* realm table index */
natid r_cnum; /* country number */
/* end of part matching struct empobj */
- short r_uid; /* realm table index */
unsigned short r_realm; /* realm number */
short r_xl, r_xh; /* horizontal bounds */
short r_yl, r_yh; /* vertical bounds */
struct natstr {
/* initial part must match struct empobj */
short ef_type;
+ short nat_uid; /* equals nat_cnum */
natid nat_cnum; /* our country number */
/* end of part matching struct empobj */
nat_status nat_stat;
#include "nsc.h"
struct nwsstr {
+ /* initial part must match struct empobj */
short ef_type;
- natid nws_ano; /* "actor" country # */
short nws_uid; /* unused */
+ /* end of part matching struct empobj */
+ natid nws_ano; /* "actor" country # */
signed char nws_vrb; /* action (verb) */
natid nws_vno; /* "victim" country # */
signed char nws_ntm; /* number of times */
struct nukstr {
/* initial part must match struct empobj */
short ef_type;
- natid nuk_own;
short nuk_uid;
+ natid nuk_own;
coord nuk_x, nuk_y; /* current loc of device */
signed char nuk_type; /* index in nchr[] */
signed char nuk_effic; /* unused, always 100% */
struct plnstr {
/* initial part must match struct empobj */
short ef_type;
- natid pln_own; /* owning country */
short pln_uid; /* plane unit id */
+ natid pln_own; /* owning country */
coord pln_x; /* plane x-y */
coord pln_y;
signed char pln_type; /* index in plchr[] */
struct sctstr {
/* initial part must match struct empobj */
short ef_type;
+ short sct_uid; /* equals sctoff(sct_x, sct_y) */
natid sct_own; /* owner's country num */
- short sct_elev; /* elevation/depth */
coord sct_x; /* x coord of sector */
coord sct_y; /* y coord of sector */
signed char sct_type; /* sector type */
coord sct_dist_y;
short sct_avail; /* available workforce for "other things" */
short sct_flags; /* temporary flags */
- short sct_fill; /* gunk */
+ short sct_elev; /* elevation/depth */
unsigned char sct_work; /* pct of civ actually working */
unsigned char sct_coastal; /* is this a coastal sector? */
signed char sct_newtype; /* for changing designations */
struct shpstr {
/* initial part must match struct empobj */
short ef_type;
- natid shp_own; /* owner's country num */
short shp_uid; /* unit id (ship #) */
+ natid shp_own; /* owner's country num */
coord shp_x; /* x location in abs coords */
coord shp_y; /* y location in abs coords */
signed char shp_type; /* index in mchr[] */
struct trdstr {
/* initial part must match struct empobj */
short ef_type;
- natid trd_owner;
short trd_uid;
+ natid trd_owner;
/* end of part matching struct empobj */
short trd_type;
short trd_unitid;
#include "types.h"
struct trtstr {
+ /* initial part must match struct empobj */
short ef_type;
- natid trt_cna; /* proposer */
short trt_uid;
+ /* end of part matching struct empobj */
+ natid trt_cna; /* proposer */
natid trt_cnb; /* acceptor */
signed char trt_status; /* treaty status */
char trt_fill;
return RET_SYN;
sect->sct_x = newx;
sect->sct_y = newy;
+ sect->sct_uid = XYOFFSET(newx, newy);
break;
case 'D':
if (!sarg_xy(p, &newx, &newy))
/* change the location of secta to that of sectb */
secta.sct_x = sectb.sct_x;
secta.sct_y = sectb.sct_y;
+ secta.sct_uid = sectb.sct_uid;
secta.sct_dist_x = sectb.sct_x;
secta.sct_dist_y = sectb.sct_y;
secta.sct_coastal = sectb.sct_coastal;
/* change the location of sectb to where secta was */
sectb.sct_x = tmp.sct_x;
sectb.sct_y = tmp.sct_y;
+ sectb.sct_uid = tmp.sct_uid;
sectb.sct_dist_x = tmp.sct_x;
sectb.sct_dist_y = tmp.sct_y;
sectb.sct_coastal = tmp.sct_coastal;
};
struct castr sect_ca[] = {
- /* uid is encoded in x, y */
+ /* uid needs to be NSC_DEITY because it discloses true origin */
+ {NSC_SHORT, NSC_DEITY | NSC_EXTRA, 0, fldoff(sctstr, sct_uid), "uid",
+ EF_SECTOR},
{NSC_NATID, 0, 0, fldoff(sctstr, sct_own), "owner", EF_NATION},
- {NSC_SHORT, NSC_DEITY, 0, fldoff(sctstr, sct_elev), "elev", EF_BAD},
{NSC_XCOORD, NSC_CONST, 0, fldoff(sctstr, sct_x), "xloc", EF_BAD},
{NSC_YCOORD, NSC_CONST, 0, fldoff(sctstr, sct_y), "yloc", EF_BAD},
{NSC_CHAR, 0, 0, fldoff(sctstr, sct_type), "des", EF_SECTOR_CHR},
{NSC_XCOORD, 0, 0, fldoff(sctstr, sct_dist_x), "xdist", EF_BAD},
{NSC_YCOORD, 0, 0, fldoff(sctstr, sct_dist_y), "ydist", EF_BAD},
{NSC_SHORT, 0, 0, fldoff(sctstr, sct_avail), "avail", EF_BAD},
+ {NSC_SHORT, NSC_DEITY, 0, fldoff(sctstr, sct_elev), "elev", EF_BAD},
{NSC_UCHAR, 0, 0, fldoff(sctstr, sct_work), "work", EF_BAD},
{NSC_UCHAR, 0, 0, fldoff(sctstr, sct_coastal), "coastal", EF_BAD},
{NSC_CHAR, 0, 0, fldoff(sctstr, sct_newtype), "newdes", EF_SECTOR_CHR},
fl_sct_init(coord x, coord y, struct sctstr *sp)
{
sp->ef_type = EF_SECTOR;
+ sp->sct_uid = XYOFFSET(x, y);
sp->sct_x = x;
sp->sct_y = y;
sp->sct_dist_x = x;
memset(&nat, 0, sizeof(nat));
for (i = 1; i < MAXNOC; i++) {
nat.ef_type = EF_NATION;
- nat.nat_cnum = i;
+ nat.nat_cnum = nat.nat_uid = i;
putnat((&nat));
}
memset(&realm, 0, sizeof(realm));
struct sctstr *sp = (struct sctstr *)ptr;
sp->ef_type = EF_SECTOR;
+ sp->sct_uid = XYOFFSET(x, y);
sp->sct_x = x;
sp->sct_y = y;
sp->sct_dist_x = x;