From: PatR Date: Wed, 27 Apr 2022 22:43:18 +0000 (-0700) Subject: extra traps followup X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8184663e0983493452dbc7a4a682a2a8d135f65;p=nethack extra traps followup "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. --- diff --git a/include/display.h b/include/display.h index a70279bdf..b28a31c8e 100644 --- a/include/display.h +++ b/include/display.h @@ -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) \ diff --git a/include/rm.h b/include/rm.h index 62add3b58..5f2162330 100644 --- a/include/rm.h +++ b/include/rm.h @@ -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) /*