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
|
@ -61,7 +61,6 @@ stre(void)
|
|||
double dtotal, r_total, eff;
|
||||
struct combat def[1];
|
||||
int dummy;
|
||||
int mines;
|
||||
|
||||
if (!snxtsct(&nstr, player->argp[1]))
|
||||
return RET_SYN;
|
||||
|
@ -96,12 +95,11 @@ stre(void)
|
|||
def->own = 0;
|
||||
eff = att_combat_eff(def);
|
||||
if (sect.sct_own == sect.sct_oldown) {
|
||||
mines = getvar(V_MINE, (s_char *)§, EF_SECTOR);
|
||||
if (mines > 0)
|
||||
pr("%7d", mines);
|
||||
if (sect.sct_mines > 0)
|
||||
pr("%7d", sect.sct_mines);
|
||||
else
|
||||
pr("%7s", "");
|
||||
eff *= (1.0 + min(mines, 20) * 0.02);
|
||||
eff *= (1.0 + min(sect.sct_mines, 20) * 0.02);
|
||||
} else {
|
||||
pr("%7s", "?");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue