diff --git a/include/budg.h b/include/budg.h index 1a5a6630..538ba0be 100644 --- a/include/budg.h +++ b/include/budg.h @@ -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); diff --git a/include/sect.h b/include/sect.h index 5a06d9d7..d512ebaf 100644 --- a/include/sect.h +++ b/include/sect.h @@ -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) diff --git a/src/lib/global/sect.c b/src/lib/global/sect.c index 3e3aeb31..41623968 100644 --- a/src/lib/global/sect.c +++ b/src/lib/global/sect.c @@ -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