shk doname for containers

Rescue some old code from bit rot.  It may be useful if the shop
side of things ever gets fixed.  (Itemized billing reveals container
contents.  I'm sure that it's in the bugzilla list but can't find it.)
This commit is contained in:
PatR
2019-07-03 13:43:24 -07:00
parent 88a48cd6ff
commit 4a74968a58

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 objnam.c $NHDT-Date: 1561081353 2019/06/21 01:42:33 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.244 $ */
/* NetHack 3.6 objnam.c $NHDT-Date: 1562186589 2019/07/03 20:43:09 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.245 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1838,6 +1838,30 @@ struct obj *obj;
return s;
}
#if 0 /* stalled-out work in progress */
/* Doname2() for itemized buying of 'obj' from a shop */
char *
payDoname(obj)
struct obj *obj;
{
static const char and_contents[] = " and its contents";
char *p = doname(obj);
if (Is_container(obj) && !obj->cknown) {
if (obj->unpaid) {
if ((int) strlen(p) + sizeof and_contents - 1 < BUFSZ - PREFIX)
Strcat(p, and_contents);
*p = highc(*p);
} else {
p = strprepend(p, "Contents of ");
}
} else {
*p = highc(*p);
}
return p;
}
#endif /*0*/
/* returns "[your ]xname(obj)" or "Foobar's xname(obj)" or "the xname(obj)" */
char *
yname(obj)