]> granicus.if.org Git - nethack/commitdiff
fix "dropping Medusa's corpse down the stairs"
authornethack.rankin <nethack.rankin>
Tue, 3 Aug 2004 02:37:44 +0000 (02:37 +0000)
committernethack.rankin <nethack.rankin>
Tue, 3 Aug 2004 02:37:44 +0000 (02:37 +0000)
     User reported the following incorrect feedback:
You drop Medusa's corpse.  corpse falls down the stairs.
and apparently thought that the problem was a glitch in the middle of the
sentence; the actual problem is that the second sentence lacks its start.

     This fix isn't perfect.  You'll now get
Medusa's corpse falls down the stairs.
for the second sentence, but
The Oracle corpse falls down the stairs.
when dealing with a unique monster who doesn't have a personal name.
Either form seems acceptable to me, but mixing them appears inconsistent.

     Probably all the uses of corpse_xname() (and its callers back up the
chain cxname(), aobjnam(), yobjnam()) need to be reviewed for usage.  I
don't have the energy for that.

doc/fixes34.4
src/dokick.c
src/objnam.c

index df5704ff61c020769678d2e2c106fae21eae517b..53409069a66cba6380cfc181f55f78634774ef95 100644 (file)
@@ -43,6 +43,7 @@ shopkeeper removal of trap from shop doorway yields an open door instead of
        a closed one if an intact open door is present
 guarantee that hostile djinn released from bottles really are hostile
 handle lava when removing or losing water walking boots
+fix incomplete sentence occuring when unique monster's corpse fell down stairs
 
 
 Platform- and/or Interface-Specific Fixes
index 5f81348f6748d5987b619c8c14cae6af2f4d5472..d40df0543ef75abc55cc349e1646cc63d9303dd5 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)dokick.c   3.4     2004/06/12      */
+/*     SCCS Id: @(#)dokick.c   3.4     2004/08/02      */
 /* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1470,7 +1470,7 @@ long num;
        Sprintf(obuf, "%s%s",
                 (otmp->otyp == CORPSE &&
                        type_is_pname(&mons[otmp->corpsenm])) ? "" : "The ",
-                xname(otmp));
+                cxname(otmp));
 
        if(num) { /* means: other objects are impacted */
            Sprintf(eos(obuf), " %s %s object%s",
index 967d0ccecf27160dd4aa378b086f7cd1a5aee07c..ac64710143c377f7de9fe50b5536df052af21093 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)objnam.c   3.4     2003/12/22      */
+/*     SCCS Id: @(#)objnam.c   3.4     2004/08/02      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -812,8 +812,12 @@ struct obj *otmp;
 boolean ignore_oquan;  /* to force singular */
 {
        char *nambuf = nextobuf();
+       int mndx = otmp->corpsenm;
+       const char *mname = (mndx != NON_PM) ? mons[mndx].mname :
+                               (const char *)"thing";  /* shouldn't happen */
 
-       Sprintf(nambuf, "%s corpse", mons[otmp->corpsenm].mname);
+       if (type_is_pname(&mons[mndx])) mname = s_suffix(mname);
+       Sprintf(nambuf, "%s corpse", mname);
 
        if (ignore_oquan || otmp->quan < 2)
            return nambuf;