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

@ -41,10 +41,10 @@
#include "queue.h"
#include "nsc.h"
#include "retreat.h"
#include "var.h"
#define LAND_MINEFF 10
#define LAND_MINFIREEFF 40 /* arty must be this effic to fire */
#define MAXLNDV 14
#define LND_MINMOBCOST 0.200
struct lndstr {
@ -71,9 +71,9 @@ struct lndstr {
s_char lnd_rpath[RET_LEN]; /* retreat path */
u_char lnd_rad_max; /* max radius for this unit */
u_char lnd_scar; /* how experienced the unit is (not used) */
s_char lnd_nv; /* current number of variables */
u_char lnd_vtype[MAXLNDV];
u_short lnd_vamt[MAXLNDV];
u_short lnd_item[I_MAX+1]; /* amount of items on board */
u_short lnd_pstage; /* plague stage */
u_short lnd_ptime; /* how many etus remain in this stage */
short lnd_land; /* pointer to transporting unit */
u_char lnd_nland;
time_t lnd_access; /* Last time mob was updated (MOB_ACCESS) */