#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, sctoff((p)->sct_x, (p)->sct_y), (p))
+#define putsect(p) ef_write(EF_SECTOR, (p)->sct_uid, (p))
#define getsectp(x, y) (struct sctstr *)ef_ptr(EF_SECTOR, sctoff((x), (y)))
#define getsectid(id) (struct sctstr *)ef_ptr(EF_SECTOR, (id))
while (!player->aborted && nxtsct(&nstr, §)) {
if ((nstr.ncond > 0) && (sect.sct_own != player->cnum))
continue;
- d = player->map[sctoff(nstr.x, nstr.y)];
+ d = player->map[sect.sct_uid];
sprintf(prompt, "%s '%c' desig? ",
xyas(nstr.x, nstr.y, player->cnum),
d ? d : ' ');
* in which case they'll see that.
* --ts
*/
- *ptr = player->bmap[sctoff(sect.sct_x, sect.sct_y)];
+ *ptr = player->bmap[sect.sct_uid];
}
if (changed)
writemap(player->cnum);
}
/* Can only check bigmap */
- mapspot = bigmap[sctoff(x, y)];
+ mapspot = bigmap[sect.sct_uid];
return mapspot == '.' || mapspot == ' ' || mapspot == 0;
}
from_des &= ~0x20;
while (nxtsct(ns, §)) {
- if (!(fromdes = from_bmap[sctoff(ns->x, ns->y)]))
+ if (!(fromdes = from_bmap[sect.sct_uid]))
continue;
- todes = to_bmap[sctoff(ns->x, ns->y)];
+ todes = to_bmap[sect.sct_uid];
if (todes &&
todes != '?' &&
todes != '.' && todes != ' ' && todes != from_des)
i = 0;
while (i < 7 && nxtsct(&ns, §)) {
/* Nasty: this relies on the iteration order */
- if (!(view[i] = player->bmap[sctoff(ns.x, ns.y)]))
+ if (!(view[i] = player->bmap[sect.sct_uid]))
view[i] = ' ';
i++;
}
static struct bp *
bp_ref(struct bp *bp, struct sctstr *sp)
{
- return &bp[XYOFFSET(sp->sct_x, sp->sct_y)];
+ return &bp[sp->sct_uid];
}
/*
if (np->nat_money < 0)
continue;
/* Get the pointer */
- infptr = &g_distptrs[XYOFFSET(sp->sct_x, sp->sct_y)];
+ infptr = &g_distptrs[sp->sct_uid];
dodistribute(sp, EXPORT,
infptr->path, infptr->imcost, infptr->excost);
}
logerror("importing...");
for (n = 0; NULL != (sp = getsectid(n)); n++) {
/* Get the pointer (we do it first so we can free if needed) */
- infptr = &g_distptrs[XYOFFSET(sp->sct_x, sp->sct_y)];
+ infptr = &g_distptrs[sp->sct_uid];
if (sp->sct_type == SCT_WATER || sp->sct_own == 0) {
#ifdef SAVE_FINISH_PATHS
if (infptr->path)
if ((sp->sct_dist_x == sp->sct_x) && (sp->sct_dist_y == sp->sct_y))
continue;
/* Set the pointer */
- infptr = &distptrs[XYOFFSET(sp->sct_x, sp->sct_y)];
+ infptr = &distptrs[sp->sct_uid];
/* now, get the dist sector */
dist = getsectp(sp->sct_dist_x, sp->sct_dist_y);
if (dist == NULL) {