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:
parent
ba86513b01
commit
eccc5cb7d7
86 changed files with 853 additions and 1226 deletions
|
@ -85,14 +85,12 @@ cens(void)
|
|||
pr(" ");
|
||||
pr("%4d", sect.sct_mobil);
|
||||
|
||||
getvec(VT_DEL, vec, (s_char *)§, EF_SECTOR);
|
||||
pr(" %c", dirstr[vec[I_UW] & 0x7]);
|
||||
pr("%c", dirstr[vec[I_FOOD] & 0x7]);
|
||||
pr(" %c", dirstr[sect.sct_del[I_UW] & 0x7]);
|
||||
pr("%c", dirstr[sect.sct_del[I_FOOD] & 0x7]);
|
||||
|
||||
getvec(VT_DIST, vec, (s_char *)§, EF_SECTOR);
|
||||
n = vec[I_UW] % 1000;
|
||||
n = sect.sct_dist[I_UW] % 1000;
|
||||
pr(" %c", n == 0 ? '.' : '0' + (n / 100));
|
||||
n = vec[I_FOOD] % 1000;
|
||||
n = sect.sct_dist[I_FOOD] % 1000;
|
||||
pr("%c ", n == 0 ? '.' : '0' + (n / 100));
|
||||
pr("%c", sect.sct_own != sect.sct_oldown ? '*' : ' ');
|
||||
|
||||
|
@ -110,8 +108,7 @@ cens(void)
|
|||
pr(" ");
|
||||
}
|
||||
if (opt_FALLOUT) {
|
||||
getvec(VT_COND, vec, (void *)§, EF_SECTOR);
|
||||
pr("%5d", vec[C_FALLOUT]);
|
||||
pr("%5d", sect.sct_fallout);
|
||||
}
|
||||
set_coastal(§);
|
||||
if (sect.sct_coastal)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue