From eca79e74e7caf131633598c90945161d43fcaa5a Mon Sep 17 00:00:00 2001 From: Erik Lunna Date: Mon, 30 Oct 2023 11:51:14 +0100 Subject: [PATCH] Fix: Mention locked/empty status of magic chest when walking on it From EvilHack commit f503b90a0c. Also, fix up the behaviour for blind characters---it gave redundant messages if other objects were on the square. --- src/hack.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hack.c b/src/hack.c index 076dacc2f..b03507e1d 100644 --- a/src/hack.c +++ b/src/hack.c @@ -2769,10 +2769,14 @@ boolean pick; done(DIED); } if (IS_MAGIC_CHEST(levl[u.ux][u.uy].typ) && !Levitation) { + char *tmp = doname(mchest); if (!Blind) - You("see here a magic chest."); - else - You("feel here a magic chest."); + You("see here %s.", tmp); + /* magic chest is already mentioned if objects are on square */ + else if (!OBJ_AT(u.ux, u.uy)) + You("feel here %s.", tmp); + /* release doname's obuf, just in case */ + maybereleaseobuf(tmp); } spotdone: if (!--inspoteffects) {