]> granicus.if.org Git - nethack/commitdiff
fix github issue #116 - farlook at corpse
authorPatR <rankin@nethack.org>
Tue, 10 Jul 2018 23:35:50 +0000 (16:35 -0700)
committerPatR <rankin@nethack.org>
Tue, 10 Jul 2018 23:35:50 +0000 (16:35 -0700)
Fixes #116

Farlook in 3.4.3 used xname() and just described any corpse as
"corpse" whether you knew the monster type or not.  3.6.x switched
to doname() and describes it as "<mon-type> corpse", but if it isn't
there anymore, the fake object contructed for it would have a random
corpse type.

For corpses and statues, the map glyph provides enough information
to give the fake object the same type as the original.  For other
items that have a monster component (figurines, tins, eggs) it does
not, nor for other doname attributes of objects in general (which
might be picked up by monsters rather than rot away).  So this fixes
the rotted-away-corpse-seems-to- become-random-corpse issue but not
the general case of the details for a remembered item which isn't
there anymore.

doc/fixes36.2
src/pager.c

index 5e1d1ad9db50909d4a483afc0fa48e2116df542f..f8af944e27688098318ba40fcf890d50c159beff 100644 (file)
@@ -68,6 +68,8 @@ shopkeeper's position in front of shop door didn't correctly handle bottom
 attempting to update permanent inventory window during restore had problems
        with unpaid items (needed shop bill before shop and its shopkeeper
        were restored) and named fruit
+remembered corpse which isn't there anymore would be described by farlook as
+       the corpse of a random monster type
 
 
 Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
index 308c84279ddb5f0fd80a6899b8c38ba14185dc7a..d44efb79533fcc34e622c065c09a327b84f368d8 100644 (file)
@@ -187,6 +187,10 @@ struct obj **obj_p;
             otmp->spe = context.current_fruit; /* give it a type */
         if (mtmp && has_mcorpsenm(mtmp)) /* mimic as corpse/statue */
             otmp->corpsenm = MCORPSENM(mtmp);
+        else if (otmp->otyp == CORPSE && glyph_is_body(glyph))
+            otmp->corpsenm = glyph - GLYPH_BODY_OFF;
+        else if (otmp->otyp == STATUE && glyph_is_statue(glyph))
+            otmp->corpsenm = glyph - GLYPH_STATUE_OFF;
     }
     /* if located at adjacent spot, mark it as having been seen up close
        (corpse type will be known even if dknown is 0, so we don't need a