]> granicus.if.org Git - nethack/commitdiff
fix messaging in obstructed() in lock.c
authornhmall <mjnh@persona.ca>
Sat, 14 Mar 2015 02:27:09 +0000 (22:27 -0400)
committerPasi Kallinen <paxed@alt.org>
Tue, 17 Mar 2015 16:47:28 +0000 (18:47 +0200)
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

doc/fixes35.0
src/lock.c

index 614bbe57fcbe854120f532a6150006e54df3c3a0..ad81178204f4d858818043713acbaa8b56f2916a 100644 (file)
@@ -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 <mon> 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
index 91e0f07288407a0196e624f792232f867aac3bd3..b57d9eb85efcf02c094d3b47840559c516de30e8 100644 (file)
@@ -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)) {