From: nhmall Date: Thu, 12 Nov 2015 05:42:52 +0000 (-0500) Subject: Repair recent tile mapping error when MAIL is undefined X-Git-Tag: NetHack-3.6.0_RC01~54^2~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39a16676772f78f8cfa4f884fb22c64760a25d2b;p=nethack Repair recent tile mapping error when MAIL is undefined 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" --- diff --git a/src/objects.c b/src/objects.c index 62e62da50..fb8499b66 100644 --- a/src/objects.c +++ b/src/objects.c @@ -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), diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 0239d84fc..e41d618e6 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -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 } };