fix #K3907 - reviving buried corpse

Burying an olog-hai corpse with a boulder resulted in a panic when
its time to revive occurred.  I was able to reproduce this once but
failed with "you feel less hassled" several times (using same save
file for multiple tests) so I'm not quite sure what was happening.

A buried corpse was allowed to revive if it was for a zombie.  This
fix extends that to auto-revivers (trolls and Riders).  The corpse
keeps its revive_mon timer rather than changing that to zombify_mon.

If/when revival of a buried troll or Rider happens while in view, it
will "claw itself out of the ground" like zombies do.
This commit is contained in:
PatR
2023-05-02 18:02:02 -07:00
parent 7a18387ff2
commit 654b7d41b2
3 changed files with 17 additions and 4 deletions

View File

@@ -2002,10 +2002,16 @@ revive_corpse(struct obj *corpse)
char cname[BUFSZ];
struct obj *container = (struct obj *) 0;
int container_where = 0;
boolean is_zomb = (mons[corpse->corpsenm].mlet == S_ZOMBIE);
int montype;
boolean is_zomb;
coordxy corpsex, corpsey;
where = corpse->where;
montype = corpse->corpsenm;
/* treat buried auto-reviver (troll, Rider?) like a zombie
so that it can dig itself out of the ground if it revives */
is_zomb = (mons[montype].mlet == S_ZOMBIE
|| (where == OBJ_BURIED && is_reviver(&mons[montype])));
is_uwep = (corpse == uwep);
chewed = (corpse->oeaten != 0);
Strcpy(cname, corpse_xname(corpse,

View File

@@ -839,12 +839,18 @@ revive(struct obj *corpse, boolean by_hero)
boolean one_of;
mmflags_nht mmflags = NO_MINVENT | MM_NOWAIT | MM_NOMSG;
int montype, cgend, container_nesting = 0;
boolean is_zomb = (mons[corpse->corpsenm].mlet == S_ZOMBIE);
boolean is_zomb;
if (corpse->otyp != CORPSE) {
impossible("Attempting to revive %s?", xname(corpse));
return (struct monst *) 0;
}
montype = corpse->corpsenm;
/* treat buried auto-reviver (troll, Rider?) like a zombie
so that it can dig itself out of the ground if it revives */
is_zomb = mons[montype].mlet == S_ZOMBIE
|| (corpse->where == OBJ_BURIED && is_reviver(&mons[montype]));
/* if this corpse is being eaten, stop doing that; this should be done
after makemon() succeeds and skipped if it fails, but waiting until
we know the result for that would be too late */
@@ -897,7 +903,6 @@ revive(struct obj *corpse, boolean by_hero)
return (struct monst *) 0;
/* prepare for the monster */
montype = corpse->corpsenm;
mptr = &mons[montype];
/* [should probably handle recorporealization first; if corpse and
ghost are at same location, revived creature shouldn't be bumped