From 58fd867cc25485904b3330899b513bf28f507add Mon Sep 17 00:00:00 2001 From: Lucien <302355268+lucien-ad-lucem@users.noreply.github.com> Date: Tue, 13 Oct 2026 06:40:19 -0700 Subject: [PATCH] Backport NetHack 1dc9f73: lookat() no longer clobbers bhitpos lookat() wrote bhitpos, the position of a missile in flight, for every monster glyph it described, and nothing reachable from it reads the value. NLE describes every printed glyph when screen_descriptions is requested, so a missile's animation flushes overwrote its own position with the squares of monsters drawn, sending it astray and, off the map, into a place_object() panic. NetHack removed the write in 1dc9f73 ("fix #K4201 - bhitpos is clobbered by lookat()"); this applies the same removal to the bundled 3.6.6 source. Co-Authored-By: Claude Fable 5.1 --- src/pager.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/pager.c b/src/pager.c index c1c7b923d..3d800af1d 100644 --- a/src/pager.c +++ b/src/pager.c @@ -453,8 +453,6 @@ char *buf, *monbuf; Sprintf(buf, "interior of %s", a_monnam(u.ustuck)); pm = u.ustuck->data; } else if (glyph_is_monster(glyph)) { - bhitpos.x = x; - bhitpos.y = y; if ((mtmp = m_at(x, y)) != 0) { look_at_monster(buf, monbuf, mtmp, x, y); pm = mtmp->data; @@ -1380,8 +1378,6 @@ boolean do_mons; /* True => monsters, False => objects */ if (glyph_is_monster(glyph)) { struct monst *mtmp; - bhitpos.x = x; /* [is this actually necessary?] */ - bhitpos.y = y; if (x == u.ux && y == u.uy && canspotself()) { (void) self_lookat(lookbuf); ++count;