Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-05-22 00:48:39 -04:00
5 changed files with 33 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 objnam.c $NHDT-Date: 1558125504 2019/05/17 20:38:24 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.239 $ */
/* NetHack 3.6 objnam.c $NHDT-Date: 1558485650 2019/05/22 00:40:50 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.241 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -199,6 +199,28 @@ int otyp;
return bufp;
}
/* typename for debugging feedback where data involved might be suspect */
char *
safe_typename(otyp)
int otyp;
{
unsigned save_nameknown;
char *res = 0;
if (otyp < STRANGE_OBJECT || otyp >= NUM_OBJECTS
|| !OBJ_NAME(objects[otyp])) {
res = nextobuf();
Sprintf(res, "glorkum[%d]", otyp);
} else {
/* force it to be treated as fully discovered */
save_nameknown = objects[otyp].oc_name_known;
objects[otyp].oc_name_known = 1;
res = simple_typename(otyp);
objects[otyp].oc_name_known = save_nameknown;
}
return res;
}
boolean
obj_is_pname(obj)
struct obj *obj;