(nchr): Move the array size to nuke.h. Add rows for configurable units.

(lchr,plchr,mchr): Add array size to land.h/plane.h/ship.h.  Add rows for
configurable units.
(ichr,pchr,dchr,intrchr): Add array size to item.h/product.h/sect.h.
This commit is contained in:
Ron Koenderink 2005-10-28 13:23:08 +00:00
parent b3ab6abf4a
commit 7c93f70ee4
8 changed files with 13 additions and 10 deletions

View file

@ -80,7 +80,7 @@ struct ichrstr {
/* variables using this structure */ /* variables using this structure */
extern struct ichrstr ichr[]; extern struct ichrstr ichr[I_MAX + 2];
/* procedures using/returning this struct */ /* procedures using/returning this struct */

View file

@ -42,6 +42,7 @@
#include "nsc.h" #include "nsc.h"
#include "retreat.h" #include "retreat.h"
#define N_MAXLAND 30
#define LAND_MINEFF 10 #define LAND_MINEFF 10
#define LAND_MINFIREEFF 40 /* arty must be this effic to fire */ #define LAND_MINFIREEFF 40 /* arty must be this effic to fire */
#define LND_MINMOBCOST 0.200 #define LND_MINMOBCOST 0.200
@ -180,7 +181,7 @@ struct lchrstr {
#define getlandp(n) \ #define getlandp(n) \
(struct lndstr *) ef_ptr(EF_LAND, n) (struct lndstr *) ef_ptr(EF_LAND, n)
extern struct lchrstr lchr[]; extern struct lchrstr lchr[N_MAXLAND + 1];
extern int lnd_maxno; extern int lnd_maxno;
struct llist { struct llist {

View file

@ -34,7 +34,7 @@
#ifndef _NUKE_H_ #ifndef _NUKE_H_
#define _NUKE_H_ #define _NUKE_H_
#define N_MAXNUKE 15 #define N_MAXNUKE 20
struct nukstr { struct nukstr {
/* initial part must match struct genitem */ /* initial part must match struct genitem */
@ -78,7 +78,7 @@ struct nchrstr {
#define NUK_BLD_WORK(lcm, hcm, oil, rad) \ #define NUK_BLD_WORK(lcm, hcm, oil, rad) \
(((lcm) + 2 * (hcm) + (oil) + (rad) + 4) / 5) (((lcm) + 2 * (hcm) + (oil) + (rad) + 4) / 5)
extern struct nchrstr nchr[]; extern struct nchrstr nchr[N_MAXNUKE + 1];
extern int nuk_maxno; extern int nuk_maxno;

View file

@ -39,6 +39,7 @@
#include "queue.h" #include "queue.h"
#include "sect.h" #include "sect.h"
#define N_MAXPLANE 40
#define PLANE_MINEFF 10 #define PLANE_MINEFF 10
/* /*
@ -142,7 +143,7 @@ struct plist {
#define getplanep(n) \ #define getplanep(n) \
(struct plnstr *) ef_ptr(EF_PLANE, n) (struct plnstr *) ef_ptr(EF_PLANE, n)
extern struct plchrstr plchr[]; extern struct plchrstr plchr[N_MAXPLANE + 1];
extern int pln_maxno; extern int pln_maxno;
struct shiplist { struct shiplist {

View file

@ -75,7 +75,7 @@ struct pchrstr {
#define P_URAN 15 #define P_URAN 15
#define P_MDUST 16 #define P_MDUST 16
extern struct pchrstr pchr[]; extern struct pchrstr pchr[P_MDUST + 2];
extern int prd_maxno; extern int prd_maxno;

View file

@ -163,7 +163,7 @@ struct dchrstr {
/* things relating to sectors */ /* things relating to sectors */
extern int sctoff(coord x, coord y); extern int sctoff(coord x, coord y);
extern struct dchrstr dchr[]; extern struct dchrstr dchr[SCT_MAXDEF + 2];
extern struct dchrstr bigcity_dchr; extern struct dchrstr bigcity_dchr;
/* Minimal efficiency of sectors that can be knocked down (bridges) */ /* Minimal efficiency of sectors that can be knocked down (bridges) */
@ -204,6 +204,6 @@ struct sctintrins {
u_char in_mcost; u_char in_mcost;
}; };
extern struct sctintrins intrchr[]; extern struct sctintrins intrchr[INT_DEF + 2];
#endif /* _SECT_H_ */ #endif /* _SECT_H_ */

View file

@ -42,6 +42,7 @@
#include "misc.h" #include "misc.h"
#include "retreat.h" #include "retreat.h"
#define N_MAXSHIPS 40
#define SHIP_MINEFF 20 #define SHIP_MINEFF 20
/* bit masks for the autonav mode flags */ /* bit masks for the autonav mode flags */
@ -184,7 +185,7 @@ struct mchrstr {
#define getshipp(n) \ #define getshipp(n) \
(struct shpstr *) ef_ptr(EF_SHIP, n) (struct shpstr *) ef_ptr(EF_SHIP, n)
extern struct mchrstr mchr[]; extern struct mchrstr mchr[N_MAXSHIPS + 1];
extern int shp_maxno; extern int shp_maxno;
struct mlist { struct mlist {

View file

@ -35,7 +35,7 @@
#include "nuke.h" #include "nuke.h"
struct nchrstr nchr[N_MAXNUKE] = { struct nchrstr nchr[] = {
/* name lcm hcm oil rads blst dam cost tech lbs flags */ /* name lcm hcm oil rads blst dam cost tech lbs flags */
{"10kt fission", 50, 50, 25, 70, 3, 70, 10000, 280, 4, 0}, {"10kt fission", 50, 50, 25, 70, 3, 70, 10000, 280, 4, 0},
{"15kt fission", 50, 50, 25, 80, 3, 90, 15000, 290, 5, 0}, {"15kt fission", 50, 50, 25, 80, 3, 90, 15000, 290, 5, 0},