]> granicus.if.org Git - nethack/commitdiff
Make getpos for doors also target drawbridges
authorPasi Kallinen <paxed@alt.org>
Fri, 27 May 2016 15:47:56 +0000 (18:47 +0300)
committerPasi Kallinen <paxed@alt.org>
Fri, 27 May 2016 15:47:56 +0000 (18:47 +0300)
include/rm.h
src/do_name.c
src/pager.c

index 5e7104898da5d93307d4698b6ff345243bdcc4f8..21f5036f79cbc0f8f6199f9facc9d24f6751489a 100644 (file)
 
 #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;
index 8e0af2934785e3d954cf18cf71d6e58983e2788f..179e0b53fecea94613c8be4310aa329390d85195 100644 (file)
@@ -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));
     }
 }
 
index 33b867ce467db8aaef56bfa9f9b8c7fba3701ae5..2e4256eeb8094da3a3665cb275ab22fd867edd9a 100644 (file)
@@ -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++) {