-/* NetHack 3.6 detect.c $NHDT-Date: 1522891623 2018/04/05 01:27:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.81 $ */
+/* NetHack 3.6 detect.c $NHDT-Date: 1542853884 2018/11/22 02:31:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.87 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
if (obj->oclass == oclass)
return obj;
-
- if (Has_contents(obj)) {
+ /*
+ * Note: we exclude SchroedingersBox because the corpse it contains
+ * isn't necessarily a corpse yet. Resolving the status would lead
+ * to complications if it turns out to be a live cat. We know that
+ * that Box can't contain anything else because putting something in
+ * would resolve the cat/corpse situation and convert to ordinary box.
+ */
+ if (Has_contents(obj) && !SchroedingersBox(obj)) {
for (otmp = obj->cobj; otmp; otmp = otmp->nobj)
if (otmp->oclass == oclass)
return otmp;
return 0;
}
-/* returns 1 if nothing was detected */
-/* returns 0 if something was detected */
+/* returns 1 if nothing was detected, 0 if something was detected */
int
food_detect(sobj)
register struct obj *sobj;
-/* NetHack 3.6 shk.c $NHDT-Date: 1515144230 2018/01/05 09:23:50 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.136 $ */
+/* NetHack 3.6 shk.c $NHDT-Date: 1542853899 2018/11/22 02:31:39 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.142 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
{
register struct obj *otmp;
+ if (SchroedingersBox(obj))
+ return;
for (otmp = obj->cobj; otmp; otmp = otmp->nobj) {
if (otmp->oclass == COIN_CLASS)
continue;
static const char *const honored[] = { "good", "honored", "most gracious",
"esteemed",
"most renowned and sacred" };
+
Strcat(buf, honored[rn2(SIZE(honored) - 1) + u.uevent.udemigod]);
if (is_vampire(youmonst.data))
Strcat(buf, (flags.female) ? " dark lady" : " dark lord");
else if (is_elf(youmonst.data))
Strcat(buf, (flags.female) ? " hiril" : " hir");
else
- Strcat(buf, !is_human(youmonst.data) ? " creature" : (flags.female)
- ? " lady"
- : " sir");
+ Strcat(buf, !is_human(youmonst.data) ? " creature"
+ : (flags.female) ? " lady"
+ : " sir");
}
void