From: nethack.rankin Date: Thu, 1 Dec 2011 03:55:14 +0000 (+0000) Subject: WA_VERBOSE X-Git-Tag: MOVE2GIT~147 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf7c2872b11c10157099ad292b159e2527f3ad2c;p=nethack WA_VERBOSE Some old wall display debugging code which gets enabled when WA_VERBOSE is defined was missing the three terrain types (tree, iron bars, grave) added way back in 3.3.0. It's extermely unlikely that anyone other than Dean might actually ever be impacted by this.... This compiles with WA_VERBOSE enabled but is otherwise untested. I haven't bothered with a fixes entry. --- diff --git a/include/rm.h b/include/rm.h index 2dc83368b..f32e94557 100644 --- a/include/rm.h +++ b/include/rm.h @@ -29,7 +29,10 @@ * +- -+- -+ | */ -/* Level location types */ +/* Level location types. [Some debugging code in src/display.c + defines array type_names[] which contains an entry for each of + these, so needs to be kept in sync if any new types are added + or existing ones renumbered.] */ #define STONE 0 #define VWALL 1 #define HWALL 2 diff --git a/src/display.c b/src/display.c index c9437b1ef..68143db75 100644 --- a/src/display.c +++ b/src/display.c @@ -1602,12 +1602,12 @@ static const char *type_names[MAX_TYPE] = { "STONE", "VWALL", "HWALL", "TLCORNER", "TRCORNER", "BLCORNER", "BRCORNER", "CROSSWALL", "TUWALL", "TDWALL", "TLWALL", "TRWALL", - "DBWALL", "SDOOR", "SCORR", "POOL", - "MOAT", "WATER", "DRAWBRIDGE_UP","LAVAPOOL", - "DOOR", "CORR", "ROOM", "STAIRS", - "LADDER", "FOUNTAIN", "THRONE", "SINK", - "ALTAR", "ICE", "DRAWBRIDGE_DOWN","AIR", - "CLOUD" + "DBWALL", "TREE", "SDOOR", "SCORR", + "POOL", "MOAT", "WATER", "DRAWBRIDGE_UP", + "LAVAPOOL", "IRON_BARS", "DOOR", "CORR", + "ROOM", "STAIRS", "LADDER", "FOUNTAIN", + "THRONE", "SINK", "GRAVE", "ALTAR", + "ICE", "DRAWBRIDGE_DOWN", "AIR", "CLOUD" }; @@ -1615,7 +1615,7 @@ static const char * type_to_name(type) int type; { - return (type < 0 || type > MAX_TYPE) ? "unknown" : type_names[type]; + return (type < 0 || type >= MAX_TYPE) ? "unknown" : type_names[type]; } static void