fix issue #1462 - objects embedded in trees

Issue reported by chappg:  on arboreal levels, when an object was
located at a stone location treated as a tree location, examining
the object would report it as embedded in stone.

The Ranger quest has arboreal levels where STONE becomes TREE, and
items that would become embedded in stone will be in trees instead.
(Sometimes kicking a tree would drop fruit onto an adjacent tree,
effectively embedding it.  For testing, it's easier just to poly
into a xorn, walk onto the tree spot, and drop something.)  The item
description code for farlook and quicklook wasn't checking for that.

The fix also corrects another bug:  an item located at a normal tree
location would just be described as itself with no mention of the
tree at all.  Attempting to walk onto it would report the terrain
and not let you move there (assuming not in xorn form), like trying
to walk into a wall.

Fixes #1462
This commit is contained in:
PatR
2025-11-24 12:37:08 -08:00
parent 88256d895a
commit 7b5d7d7ae6
4 changed files with 28 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 extern.h $NHDT-Date: 1738638877 2025/02/03 19:14:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1476 $ */
/* NetHack 3.7 extern.h $NHDT-Date: 1764044196 2025/11/24 20:16:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1509 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1657,6 +1657,7 @@ extern struct obj *mk_named_object(int, struct permonst *,
coordxy, coordxy,
const char *) ;
extern struct obj *rnd_treefruit_at(coordxy, coordxy);
extern boolean is_treefruit(struct obj *) NONNULLARG1;
extern void set_corpsenm(struct obj *, int) NONNULLARG1;
extern long rider_revival_time(struct obj *, boolean) NONNULLARG1;
extern void start_corpse_timeout(struct obj *) NONNULLARG1;