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