Support definition of additional sector types in sector.config:

(SCT_TYPE_MAX): New.
(dchr): Use it instead of SCT_MAXDEF to size the table.
(SCT_EFFIC): Likewise.  Move from sect.h to budg.h.
This commit is contained in:
Markus Armbruster 2006-06-22 19:52:24 +00:00
parent cf1c69543e
commit e81828ec4c
3 changed files with 6 additions and 3 deletions

View file

@ -34,6 +34,8 @@
#ifndef BUDG_H
#define BUDG_H
#define SCT_EFFIC (SCT_TYPE_MAX + 1)
void fill_update_array(int *bp, struct sctstr *sp);
int gt_bg_nmbr(int *bp, struct sctstr *sp, i_type comm);
void pt_bg_nmbr(int *bp, struct sctstr *sp, i_type comm, int amount);

View file

@ -153,7 +153,7 @@ struct dchrstr {
#define SCT_BTOWER 33 /* Bridge tower */
#define SCT_MAXDEF 33 /* highest sector type in header files */
#define SCT_EFFIC 34 /* used in update & budget */
#define SCT_TYPE_MAX 39
#define getsect(x, y, p) ef_read(EF_SECTOR, sctoff((x), (y)), (p))
#define putsect(p) ef_write(EF_SECTOR, sctoff((p)->sct_x, (p)->sct_y), (p))
@ -163,7 +163,7 @@ struct dchrstr {
/* things relating to sectors */
extern int sctoff(coord x, coord y);
extern struct dchrstr dchr[SCT_MAXDEF + 2];
extern struct dchrstr dchr[SCT_TYPE_MAX + 1];
extern struct dchrstr bigcity_dchr;
#define IS_BIG_CITY(type) (dchr[(type)].d_pkg == UPKG)

View file

@ -43,8 +43,9 @@
/*
* Table of sector designations
* Initialized on startup from sect.config and deity custom config (if any).
* Terminated by a sentinel with null d_name.
*/
struct dchrstr dchr[SCT_MAXDEF + 2];
struct dchrstr dchr[SCT_TYPE_MAX + 1];
/*
* Table of infrastructure types