]> git.pond.sub.org Git - empserver/commitdiff
Support definition of additional sector types in sector.config:
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 22 Jun 2006 19:52:24 +0000 (19:52 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 22 Jun 2006 19:52:24 +0000 (19:52 +0000)
(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.

include/budg.h
include/sect.h
src/lib/global/sect.c

index 1a5a663062029579d1d041025d0a91fe4492a192..538ba0be154a825c42629fac28f56a17103d7ff1 100644 (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);
index 5a06d9d71f180be78012ef91489420f8dcd598ce..d512ebaf4d4e90b76e88cc544758a987fddb15f5 100644 (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)
 
index 3e3aeb3142533c193c21045895c15bda24cdbaee..41623968ce5ec897aad3edd4f99786a6b868dc66 100644 (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