diff --git a/src/detect.c b/src/detect.c index 57ee916ce..416c2611f 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1,4 +1,4 @@ -/* 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. */ @@ -165,8 +165,14 @@ char oclass; 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; @@ -442,8 +448,7 @@ outgoldmap: 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; diff --git a/src/shk.c b/src/shk.c index 472b1f165..c2895a29f 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1,4 +1,4 @@ -/* 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. */ @@ -2400,6 +2400,8 @@ register struct monst *shkp; { register struct obj *otmp; + if (SchroedingersBox(obj)) + return; for (otmp = obj->cobj; otmp; otmp = otmp->nobj) { if (otmp->oclass == COIN_CLASS) continue; @@ -2597,15 +2599,16 @@ char *buf; 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