From: Pasi Kallinen Date: Fri, 27 May 2016 15:47:56 +0000 (+0300) Subject: Make getpos for doors also target drawbridges X-Git-Tag: NetHack-3.6.1_RC01~737 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d51db5a992e9513ca77bc5999b8878edd937fe2c;p=nethack Make getpos for doors also target drawbridges --- diff --git a/include/rm.h b/include/rm.h index 5e7104898..21f5036f7 100644 --- a/include/rm.h +++ b/include/rm.h @@ -227,6 +227,10 @@ #define DARKROOMSYM (Is_rogue_level(&u.uz) ? S_stone : S_darkroom) +#define is_cmap_trap(i) ((i) >= S_arrow_trap && (i) <= S_polymorph_trap) +#define is_cmap_drawbridge(i) ((i) >= S_vodbridge && (i) <= S_hcdbridge) +#define is_cmap_door(i) ((i) >= S_vodoor && (i) <= S_hcdoor) + struct symdef { uchar sym; const char *explanation; diff --git a/src/do_name.c b/src/do_name.c index 8e0af2934..179e0b53f 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -137,11 +137,9 @@ int glyph, gloc; && glyph != objnum_to_glyph(BOULDER) && glyph != objnum_to_glyph(ROCK)); case GLOC_DOOR: return (glyph_is_cmap(glyph) - && ((glyph_to_cmap(glyph) == S_hcdoor) - || (glyph_to_cmap(glyph) == S_vcdoor) - || (glyph_to_cmap(glyph) == S_hodoor) - || (glyph_to_cmap(glyph) == S_vodoor) - || (glyph_to_cmap(glyph) == S_ndoor))); + && (is_cmap_door(glyph_to_cmap(glyph)) + || is_cmap_drawbridge(glyph_to_cmap(glyph)) + || glyph_to_cmap(glyph) == S_ndoor)); } } diff --git a/src/pager.c b/src/pager.c index 33b867ce4..2e4256eeb 100644 --- a/src/pager.c +++ b/src/pager.c @@ -775,9 +775,6 @@ const char **firstmatch; } } -#define is_cmap_trap(i) ((i) >= S_arrow_trap && (i) <= S_polymorph_trap) -#define is_cmap_drawbridge(i) ((i) >= S_vodbridge && (i) <= S_hcdbridge) - /* Now check for graphics symbols */ alt_i = (sym == (looked ? showsyms[0] : defsyms[0].sym)) ? 0 : (2 + 1); for (hit_trap = FALSE, i = 0; i < MAXPCHARS; i++) {