]> granicus.if.org Git - nethack/commitdiff
WA_VERBOSE
authornethack.rankin <nethack.rankin>
Thu, 1 Dec 2011 03:55:14 +0000 (03:55 +0000)
committernethack.rankin <nethack.rankin>
Thu, 1 Dec 2011 03:55:14 +0000 (03:55 +0000)
     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.

include/rm.h
src/display.c

index 2dc83368b74f0a4fba6f260d0a7680dd9726ee34..f32e945571c1a378c7912fab09c53d97e9ac0153 100644 (file)
  * +-          -+-             -+              |
  */
 
-/* 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
index c9437b1ef0345b5e0a9a0f68c5c3ab1c244e0a51..68143db75618cc07fadff29aa6db20f84c16065d 100644 (file)
@@ -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