]> granicus.if.org Git - nethack/commitdiff
extra traps followup
authorPatR <rankin@nethack.org>
Wed, 27 Apr 2022 22:43:18 +0000 (15:43 -0700)
committerPatR <rankin@nethack.org>
Wed, 27 Apr 2022 22:43:18 +0000 (15:43 -0700)
"add glyphs+tiles for door+chest traps",
commit d1217b9f2565a5db7572c7e80c36372115465a1d,
missed a couple of S_vibrating_square references, resulting in
screwed up rendering of zaps and explosions.

include/display.h
include/rm.h

index a70279bdf2d05dee4bf720a12e76c44f43b61b04..b28a31c8e5c08dff4e3ecdc199def8257278c786 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 display.h       $NHDT-Date: 1641940939 2022/01/11 22:42:19 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.64 $ */
+/* NetHack 3.7 display.h       $NHDT-Date: 1651099381 2022/04/27 22:43:01 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.67 $ */
 /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
 /* and Dave Cohrs, 1990.                                          */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -598,7 +598,8 @@ enum glyph_offsets {
         : ((cmap_idx) <= S_trwall) ? cmap_walls_to_glyph(cmap_idx)         \
         : ((cmap_idx) <  S_altar) ? cmap_a_to_glyph(cmap_idx)              \
         : ((cmap_idx) == S_altar) ? altar_to_glyph(AM_NEUTRAL)             \
-        : ((cmap_idx) <= S_vibrating_square) ? cmap_b_to_glyph(cmap_idx)   \
+        : ((cmap_idx) <  S_arrow_trap + MAXTCHARS)                         \
+          ? cmap_b_to_glyph(cmap_idx)                                      \
         : ((cmap_idx) <= S_goodpos) ? cmap_c_to_glyph(cmap_idx)            \
         : NO_GLYPH)
 
@@ -668,7 +669,7 @@ enum glyph_offsets {
         (glyph) < (5 + GLYPH_ALTAR_OFF))
 #define glyph_is_cmap_b(glyph) \
     ((glyph) >= GLYPH_CMAP_B_OFF && \
-        ((glyph) < (((S_vibrating_square - S_grave) + 1) + GLYPH_CMAP_B_OFF)))
+        ((glyph) < ((S_arrow_trap + MAXTCHARS - S_grave) + GLYPH_CMAP_B_OFF)))
 #define glyph_is_cmap_zap(glyph) \
     ((glyph) >= GLYPH_ZAP_OFF && (glyph) < ((NUM_ZAP << 2) + GLYPH_ZAP_OFF))
 #define glyph_is_cmap_c(glyph) \
index 62add3b5826dddabc86ca5c7e5d07890abc40b88..5f216233010d7c5050abf5ed886a91540a4bc254 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 rm.h    $NHDT-Date: 1599434249 2020/09/06 23:17:29 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.84 $ */
+/* NetHack 3.7 rm.h    $NHDT-Date: 1651099392 2022/04/27 22:43:12 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.94 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Pasi Kallinen, 2017. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -412,8 +412,8 @@ typedef struct {
  * Convert a defsym number into a trap number.
  * Assumes that arrow trap will always be the first trap.
  */
-#define trap_to_defsym(t) (S_arrow_trap + (t) -1)
-#define defsym_to_trap(d) ((d) -S_arrow_trap + 1)
+#define trap_to_defsym(t) (S_arrow_trap + (t) - 1)
+#define defsym_to_trap(d) ((d) - S_arrow_trap + 1)
 
 #define OBJ_AT(x, y) (g.level.objects[x][y] != (struct obj *) 0)
 /*