From: PatR Date: Fri, 26 Feb 2016 22:37:07 +0000 (-0800) Subject: fix bz 12 - long worm inventory feedback X-Git-Tag: NetHack-3.6.1_RC01~899 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d7e51e88ac464c0984da206c77d47a4e8f289b5;p=nethack fix bz 12 - long worm inventory feedback I initially misunderstood this bug report about a nymph who was polymorphed into a long worm while carrying a cursed figurine. It wasn't about a long worm having inventory or about probing of the worm's tail revealing that it had inventory, it was about the message given when the cursed figurine activated itself. If that happened while the head was out of view but at least one tail segment was visible, the message about the new monster emerging from the long worm's backpack implied that that pack was carried by the tail segment. Only give the emerge-from-backpack message when the worm's head is visible. Likewise if a carried egg hatches. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 2a1cd5d77..4a9403068 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -165,6 +165,10 @@ when examining hidden monsters (probing, persistent monster detection), tell some quest text corrections use a much tighter upper bound when summoning nasties; old method could theoretically create 200 critters at a time +if a long worm inherited inventory from a previous shape, and if an egg or + figurine in that inventory hatched or auto-activated, messages were + given when hero could see any tail segment even if head was unseen, + making it seem as if worm's inventory was kept in the visible segment Platform- and/or Interface-Specific Fixes diff --git a/src/apply.c b/src/apply.c index e993db834..2af9d245d 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 apply.c $NHDT-Date: 1455140802 2016/02/10 21:46:42 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.220 $ */ +/* NetHack 3.6 apply.c $NHDT-Date: 1456526104 2016/02/26 22:35:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.221 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1966,8 +1966,8 @@ long timeout; if (mtmp) { char and_vanish[BUFSZ]; struct obj *mshelter = level.objects[mtmp->mx][mtmp->my]; - Sprintf(monnambuf, "%s", an(m_monnam(mtmp))); + Sprintf(monnambuf, "%s", an(m_monnam(mtmp))); and_vanish[0] = '\0'; if ((mtmp->minvis && !See_invisible) || (mtmp->data->mlet == S_MIMIC @@ -2009,11 +2009,13 @@ long timeout; case OBJ_MINVENT: if (cansee_spot && !silent && !suppress_see) { struct monst *mon; + mon = figurine->ocarry; /* figurine carrying monster might be invisible */ - if (canseemon(figurine->ocarry)) { + if (canseemon(figurine->ocarry) + && (!mon->wormno || cansee(mon->mx, mon->my))) Sprintf(carriedby, "%s pack", s_suffix(a_monnam(mon))); - } else if (is_pool(mon->mx, mon->my)) + else if (is_pool(mon->mx, mon->my)) Strcpy(carriedby, "empty water"); else Strcpy(carriedby, "thin air"); diff --git a/src/timeout.c b/src/timeout.c index 7370b8b05..cb93622d7 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 timeout.c $NHDT-Date: 1452660198 2016/01/13 04:43:18 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.64 $ */ +/* NetHack 3.6 timeout.c $NHDT-Date: 1456526165 2016/02/26 22:36:05 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.65 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -614,14 +614,17 @@ long timeout; case OBJ_MINVENT: if (cansee_hatchspot) { /* egg carrying monster might be invisible */ - if (canseemon(egg->ocarry)) { + mon2 = egg->ocarry; + if (canseemon(mon2) + && (!mon2->wormno || cansee(mon2->mx, mon2->my))) { Sprintf(carriedby, "%s pack", - s_suffix(a_monnam(egg->ocarry))); + s_suffix(a_monnam(mon2))); knows_egg = TRUE; - } else if (is_pool(mon->mx, mon->my)) + } else if (is_pool(mon->mx, mon->my)) { Strcpy(carriedby, "empty water"); - else + } else { Strcpy(carriedby, "thin air"); + } You_see("%s %s out of %s!", monnambuf, locomotion(mon->data, "drop"), carriedby); }