From 03a2c61de4da60852e0e39359f0e4bab321533d2 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 25 Apr 2011 10:27:32 +0200 Subject: [PATCH] Better document how .config must match compiled-in UIDs --- include/item.h | 1 + include/sect.h | 4 ++-- src/lib/global/infra.config | 5 ++++- src/lib/global/item.config | 3 +++ src/lib/global/sect.config | 4 ++++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/item.h b/include/item.h index 4d6861ce8..caf159b40 100644 --- a/include/item.h +++ b/include/item.h @@ -47,6 +47,7 @@ enum { NUMPKG = BPKG + 1 }; +/* Item types, must match item.config */ typedef enum { I_NONE = -1, I_CIVIL, diff --git a/include/sect.h b/include/sect.h index ec6e30c6b..e52cd6e23 100644 --- a/include/sect.h +++ b/include/sect.h @@ -121,8 +121,7 @@ struct dchrstr { char *d_name; /* full name of sector type */ }; - /* sector types (must agree with order in dchr, empglb.c) */ - +/* Sector types, must match sect.config */ #define SCT_WATER 0 /* basics */ #define SCT_MOUNT 1 #define SCT_SANCT 2 @@ -195,6 +194,7 @@ extern struct dchrstr dchr[SCT_TYPE_MAX + 2]; #define SCT_LANDMINES(sp) \ (SCT_MINES_ARE_SEAMINES((sp)) ? 0 : (sp)->sct_mines) +/* Sector infrastructure types, must match infra.config */ #define INT_ROAD 0 #define INT_RAIL 1 #define INT_DEF 2 diff --git a/src/lib/global/infra.config b/src/lib/global/infra.config index 8f539a829..9128e2351 100644 --- a/src/lib/global/infra.config +++ b/src/lib/global/infra.config @@ -27,7 +27,7 @@ # infra.config: Infrastructure characteristics # # Known contributors to this file: -# Markus Armbruster, 2006 +# Markus Armbruster, 2006-2011 # # Derived from sect.c; known contributors: # Dave Pare, 1986 @@ -37,6 +37,9 @@ # Steve McClure, 1998 # +# Row order is relevant, it must match the compiled-in order defined +# in sect.h + # Do not edit this file to customize a game! Create your own custom # configuration file(s), best next to your econfig, and name them in # econfig key custom_tables. diff --git a/src/lib/global/item.config b/src/lib/global/item.config index 67f6531b0..b9428d515 100644 --- a/src/lib/global/item.config +++ b/src/lib/global/item.config @@ -32,6 +32,9 @@ # Derived from item.c; no known contributors. # +# The item types (column uid) must match the compiled-in types defined +# in item.h. + # Columns pkg are indexed by packing types in compiled-in table # packing. diff --git a/src/lib/global/sect.config b/src/lib/global/sect.config index 2340de9a9..52dcc5cda 100644 --- a/src/lib/global/sect.config +++ b/src/lib/global/sect.config @@ -37,6 +37,9 @@ # Steve McClure, 1998 # +# The sector types (column uid) must match the compiled-in types +# defined in sect.h. + # Sector terrain (column terra) is the uid of the underlying terrain # sector type. Sector types that occur in that column are terrain # types, and must have themselves as terrain. @@ -97,4 +100,5 @@ uid mnem terra prd peff mob0 mob1 nav pkg ostr dstr val cost bui lcm hcm maint 31 "e" 4 -1 0 0.4 0.2 land norm 1.0 2.0 7 0 1 0 0 0 1000 "enlistment center" 32 "~" 32 -1 0 0.4 0.2 land norm 1.0 1.5 1 -1 1 0 0 0 100 "plains" 33 "@" 0 -1 0 0.4 0.0 land norm 1.0 1.5 4 -1 1 0 0 0 100 "bridge tower" +# Deity-defined sector types go here /config -- 2.43.0