From 79f3491b21081e6d2ae2118c6d680c2150ca110d Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 8 Feb 2023 17:08:20 +0200 Subject: [PATCH] Fix hero unhiding maybe_unhide_at tried to handle both a monster and hero, but hero being hidden is in u.uundetected flag, and the code was only checking the monster mundetected field. The code should probably be changed, either to change all uses of the u.uundetected to gy.youmonster.mundetected, or perhaps use a macro ... but these changes are all too big for me to tackle for now. --- src/mon.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mon.c b/src/mon.c index 53bbc7508..fa6d3581a 100644 --- a/src/mon.c +++ b/src/mon.c @@ -4128,10 +4128,15 @@ void maybe_unhide_at(coordxy x, coordxy y) { struct monst *mtmp; + boolean undetected = FALSE; - if ((mtmp = m_at(x, y)) == 0 && u_at(x, y)) + if ((mtmp = m_at(x, y)) == 0 && u_at(x, y)) { mtmp = &gy.youmonst; - if (mtmp && mtmp->mundetected + undetected = u.uundetected; + } else { + undetected = mtmp->mundetected; + } + if (mtmp && undetected && ((hides_under(mtmp->data) && (!OBJ_AT(x, y) || mtmp->mtrapped)) || (mtmp->data->mlet == S_EEL && !is_pool(x, y)))) (void) hideunder(mtmp);