fixes entry and tweaks for PR #871 - revive corpse

Pull requet from entrez:  give better feedback than "it" when hero
observes a corpse reviving into a monster that can't be seen.

Tweak reviving from a container which was coded as if the container
was optional.  That can lead to confusion when someone reads the
code so make the situation more explicit.

Fixes #871
This commit is contained in:
PatR
2022-09-20 14:33:39 -07:00
parent 74704c8836
commit 0145a020c1
2 changed files with 10 additions and 7 deletions

View File

@@ -1023,6 +1023,7 @@ cannot kick while squeezed on top of a boulder
room stocking would put multiple items on the same spot
splitting a stack of named, shop-owned objects while perm_invent is enabled
produced impossible "unpaid_cost: object wasn't on any bill."
more consistent feedback if a reviving corpse becomes an unseen monster
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository

View File

@@ -1937,7 +1937,8 @@ revive_corpse(struct obj *corpse)
chewed ? "bite-covered" : (const char *) 0,
CXN_SINGULAR));
mcarry = (where == OBJ_MINVENT) ? corpse->ocarry : 0;
get_obj_location(corpse, &corpsex, &corpsey, CONTAINED_TOO | BURIED_TOO);
(void) get_obj_location(corpse, &corpsex, &corpsey,
CONTAINED_TOO | BURIED_TOO);
if (where == OBJ_CONTAINED) {
struct monst *mtmp2;
@@ -1974,7 +1975,8 @@ revive_corpse(struct obj *corpse)
if (canseemon(mtmp)) {
pline("%s rises from the dead%s!",
chewed ? Adjmonnam(mtmp, "bite-covered")
: Monnam(mtmp), effect);
: Monnam(mtmp),
effect);
} else {
pline("%s disappears%s!", The(cname), effect);
}
@@ -2000,15 +2002,15 @@ revive_corpse(struct obj *corpse)
doesn't have knowledge to make here. */
const char *mnam = canspotmon(mtmp) ? Amonnam(mtmp) : Something;
if (container_where == OBJ_MINVENT && mcarry && canseemon(mcarry)
&& container) {
if (!container) {
impossible("reviving corpse from non-existent container");
} else if (mcarry && canseemon(mcarry)) {
pline("%s writhes out of %s!", mnam, yname(container));
} else if (container_where == OBJ_INVENT && container) {
} else if (container_where == OBJ_INVENT) {
Strcpy(sackname, an(xname(container)));
pline("%s %s out of %s in your pack!", mnam,
locomotion(mtmp->data, "writhes"), sackname);
} else if (container_where == OBJ_FLOOR && container
} else if (container_where == OBJ_FLOOR
&& cansee(corpsex, corpsey)) {
Strcpy(sackname, an(xname(container)));
pline("%s escapes from %s!", mnam, sackname);