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

@ -103,7 +103,7 @@ detonate(struct plnstr *pp, int x, int y)
continue;
}
if (opt_FALLOUT)
fallout = getvar(V_FALLOUT, (s_char *)&sect, EF_SECTOR);
fallout = sect.sct_fallout;
sect_damage(&sect, damage, 0);
if (sect.sct_x == x && sect.sct_y == y)
retval = damage;
@ -112,7 +112,7 @@ detonate(struct plnstr *pp, int x, int y)
fallout += damage * 30;
else
fallout += damage * 3;
putvar(V_FALLOUT, fallout, (s_char *)&sect, EF_SECTOR);
sect.sct_fallout = fallout;
}
if (damage > 100) {
makelost(EF_SECTOR, sect.sct_own, 0, sect.sct_x, sect.sct_y);