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
|
@ -31,18 +31,6 @@
|
|||
* John Yockey, 2001
|
||||
*/
|
||||
|
||||
/*
|
||||
#include <ctype.h>
|
||||
#include "player.h"
|
||||
#include "sect.h"
|
||||
#include "news.h"
|
||||
#include "xy.h"
|
||||
#include "nat.h"
|
||||
#include "path.h"
|
||||
#include "map.h"
|
||||
#include "commands.h"
|
||||
*/
|
||||
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "land.h"
|
||||
|
@ -79,12 +67,11 @@ sabo(void)
|
|||
}
|
||||
if (!getsect(land.lnd_x, land.lnd_y, §))
|
||||
continue;
|
||||
getvec(VT_ITEM, vec, (s_char *)&land, EF_LAND);
|
||||
if (vec[I_SHELL] == 0) {
|
||||
if (land.lnd_item[I_SHELL] == 0) {
|
||||
pr("%s has no shells.\n", prland(&land));
|
||||
continue;
|
||||
}
|
||||
putvar(V_SHELL, vec[I_SHELL] - 1, (s_char *)&land, EF_LAND);
|
||||
--land.lnd_item[I_SHELL];
|
||||
|
||||
odds = LND_SPY_DETECT_CHANCE(land.lnd_effic);
|
||||
if (chance(odds)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue