From 1dc9f7324a28ee83c5196549ed4737673f7f31a0 Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 14 Jul 2024 11:24:49 -0700 Subject: [PATCH] fix #K4201 - bhitpos is clobbered by lookat() The look-at-screen code was setting bhitpos before calling look_at_monster() but that hasn't been needed for around 25 years. Fix is trivial. However, having such a low level routine as show_glyph() call do_screen_description() seems like a recipe for trouble. --- src/pager.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/pager.c b/src/pager.c index 5c2b8de8d..1c93d494e 100644 --- a/src/pager.c +++ b/src/pager.c @@ -651,8 +651,6 @@ lookat(coordxy x, coordxy y, char *buf, char *monbuf) Sprintf(buf, "interior of %s", mon_nam(u.ustuck)); pm = u.ustuck->data; } else if (glyph_is_monster(glyph)) { - gb.bhitpos.x = x; - gb.bhitpos.y = y; if ((mtmp = m_at(x, y)) != 0) { look_at_monster(buf, monbuf, mtmp, x, y); pm = mtmp->data; @@ -1901,8 +1899,6 @@ look_all( if (glyph_is_monster(glyph)) { struct monst *mtmp; - gb.bhitpos.x = x; /* [is this actually necessary?] */ - gb.bhitpos.y = y; if (u_at(x, y) && canspotself()) { (void) self_lookat(lookbuf); ++count;