From: nhmall Date: Sat, 14 Mar 2015 02:27:09 +0000 (-0400) Subject: fix messaging in obstructed() in lock.c X-Git-Tag: NetHack-3.6.0_RC01~605 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ece3385900822518c00610c05c4dfa3163201e00;p=nethack fix messaging in obstructed() in lock.c From ais523's recent list of bugs: If a long worm tail is blocking the door, and you're blind and not telepathic, attempting to close the door marks the position of its head. From an email received in late September 2014 before the git conversion: > I was trying to close a door, not noticing that there was a garter > snake there, and this message resulted: > The garter snake stands in the way! > I haven't tried it with any other monsters without feet, but > "stands in the way" appears to be the wrong way to describe > this situation... Both of the above were found in the same function in lock.c --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 614bbe57f..ad8117820 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -877,6 +877,7 @@ charge for a boulder that fills a pit in shop abuse wisdom in keeping with Rider eating message message inconsistency: death message "swallowed whole" was preceded by "You bite into" +improve the messaging when a monster you can't see is causing an obstruction Platform- and/or Interface-Specific Fixes diff --git a/src/lock.c b/src/lock.c index 91e0f0728..b57d9eb85 100644 --- a/src/lock.c +++ b/src/lock.c @@ -627,13 +627,16 @@ register int x, y; boolean quietly; { register struct monst *mtmp = m_at(x, y); + boolean is_worm_tail = ((mtmp->mx != x) || (mtmp->my != y)); if(mtmp && mtmp->m_ap_type != M_AP_FURNITURE) { if (mtmp->m_ap_type == M_AP_OBJECT) goto objhere; - if (!quietly) pline("%s stands in the way!", !canspotmon(mtmp) ? - "Some creature" : Monnam(mtmp)); + if (!quietly) pline("%s %s in the way!", + is_worm_tail ? "Something" : + !canspotmon(mtmp) ? "Some creature" : Monnam(mtmp), + slithy(mtmp->data) ? "is situated" : "stands"); if (!canspotmon(mtmp)) - map_invisible(mtmp->mx, mtmp->my); + map_invisible(x, y); return(TRUE); } if (OBJ_AT(x, y)) {