Sectors need space for items, deliveries and distribution thresholds.

To save space, the ancients invented `variables': a collection of
key-value pairs, missing means zero value, space for `enough' keys.
This complicates the code, as assigning to a `variable' can fail for
lack of space.  Over time, `enough' increased, and for quite some time
now `variables' have been *wasting* space.  This changeset replaces
them, except in struct mchrstr, struct lchrstr and struct pchrstr,
where they are read-only, and will be replaced later.  It is only a
first step; further cleanup is required.  To simplify and minimize
this necessarily huge changeset, the new item[] arrays have an unused
slot 0, and the old variable types V_CIVIL, ... are still defined, but
must have the same values as the item types I_CIVIL, ...
This commit is contained in:
Markus Armbruster 2004-03-03 16:54:22 +00:00
parent ba86513b01
commit eccc5cb7d7
86 changed files with 853 additions and 1226 deletions

View file

@ -73,7 +73,7 @@ rout(void)
if ((ip = whatitem(player->argp[1], "What item? ")) == 0)
return RET_SYN;
i_del = V_DEL(ip - ichr);
i_del = ip->i_vtype;;
if (player->argp[2] == (s_char *)0) {
if ((str = getstring("(sects)? ", buf1)) == 0)
return RET_SYN;
@ -122,7 +122,7 @@ rout(void)
if (!player->owner)
continue;
p = &map[ns.dy][ns.dx * 2];
if ((dir = getvar(i_del, (s_char *)&sect, EF_SECTOR) & 0x7) &&
if ((dir = sect.sct_del[i_del] & 0x7) &&
nstr_exec(cond, ncond, (s_char *)&sect, EF_SECTOR))
memcpy(p, routech[dir][0], 3);
p[1] = dchr[sect.sct_type].d_mnem;