]> granicus.if.org Git - nethack/commitdiff
Repair recent tile mapping error when MAIL is undefined
authornhmall <mjnh@persona.ca>
Thu, 12 Nov 2015 05:42:52 +0000 (00:42 -0500)
committernhmall <mjnh@persona.ca>
Thu, 12 Nov 2015 05:42:52 +0000 (00:42 -0500)
 Changes to be committed:
modified:   src/objects.c
modified:   win/share/tilemap.c

Warnings during tile builds (and incorrect tile mappings
at run time when MAIL wasn't defined):
Creating 16x16 binary tile files (this may take some time)
warning: for tile 325 (numbered 325) of objects.txt,
        found 'ETAOIN SHRDLU' while expecting 'stamped / mail'
warning: for tile 326 (numbered 326) of objects.txt,
        found 'LOREM IPSUM' while expecting 'ETAOIN SHRDLU'

The recent addition of the first new extra scroll descriptions in a
very long time caused this problem to show up when MAIL was undefined.

There was a magic number in use that made an assumption that there
were only 4 such extra scroll descriptions, those being
"FOOBIE BLETCH", "TEMOV","GARVEN DEH","READ ME"

src/objects.c
win/share/tilemap.c

index 62e62da50390da8eccdb03559d8417291ff78a6c..fb8499b66a786e236779c27677aa754ccda95f88 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 objects.c       $NHDT-Date: 1444617222 2015/10/12 02:33:42 $  $NHDT-Branch: master $:$NHDT-Revision: 1.46 $ */
+/* NetHack 3.6 objects.c       $NHDT-Date: 1447306896 2015/11/12 05:41:36 $  $NHDT-Branch: master $:$NHDT-Revision: 1.48 $ */
 /* Copyright (c) Mike Threepoint, 1989.                                  */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -847,6 +847,7 @@ SCROLL("punishment",            "VE FORBRYDERNE",  1,  15, 300),
 SCROLL("charging",                "HACKEM MUCHE",  1,  15, 300),
 SCROLL("stinking cloud",             "VELOX NEB",  1,  15, 300),
 /* extra descriptions, shuffled into use at start of new game */
+/* Code in win/share/tilemap.c depends on SCR_STINKING_CLOUD preceding these */
 SCROLL(None,                     "FOOBIE BLETCH",  1,   0, 100),
 SCROLL(None,                             "TEMOV",  1,   0, 100),
 SCROLL(None,                        "GARVEN DEH",  1,   0, 100),
index 0239d84fcbe633b4e229c34afbd7f54c43b62444..e41d618e6447f525b19ee662c9adf7a0b9101076 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 tilemap.c       $NHDT-Date: 1432512803 2015/05/25 00:13:23 $  $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */
+/* NetHack 3.6 tilemap.c       $NHDT-Date: 1447306925 2015/11/12 05:42:05 $  $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ */
 /* NetHack may be freely redistributed.  See license for details. */
 
 /*
@@ -28,6 +28,8 @@ extern void FDECL(exit, (int));
 #define OBJ_GLYPH 2
 #define OTH_GLYPH 3 /* fortunately unnecessary */
 
+#define EXTRA_SCROLL_DESCR_COUNT ((SCR_BLANK_PAPER - SCR_STINKING_CLOUD) - 1)
+
 /* note that the ifdefs here should be the opposite sense from monst.c/
  * objects.c/rm.h
  */
@@ -64,7 +66,7 @@ struct conditionals {
  * don't know what a slime mold should look like when renamed anyway
  */
 #ifndef MAIL
-    { OBJ_GLYPH, SCR_STINKING_CLOUD + 4, "stamped / mail" },
+    { OBJ_GLYPH, SCR_STINKING_CLOUD + EXTRA_SCROLL_DESCR_COUNT, "stamped / mail" },
 #endif
     { 0, 0, 0 }
 };