From 1dab134fce2a851df43a8c3f46589eb4e4c6abd8 Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Mon, 28 Aug 2023 17:51:29 -0400 Subject: [PATCH] Fix: rising from the grave as a zombie When the hero is killed by a zombie, she is supposed to arise from the grave as a zombie of a type matching her race. Commit 580c5a6 broke this inadvertently -- done_in_by was passing gy.youmonst.data to zombie_form() and relying on the old behavior where it attempted to include the hero's race in is_elf, is_orc, etc if the permonst matched the hero's role. Because this no longer works, zombie_form was only returning PM_HUMAN_ZOMBIE when passed the role permonst of an unpolymorphed hero. Use gu.urace.zombienum instead. This would have to be a little more sophisticated (falling back to zombie_form() if Upolyd) if a polymorphed hero with unchanging could die via done_in_by but that's not currently possible as far as I can tell. --- src/end.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/end.c b/src/end.c index f375c905e..c2e2fe8bd 100644 --- a/src/end.c +++ b/src/end.c @@ -781,8 +781,8 @@ done_in_by(struct monst *mtmp, int how) u.ugrave_arise = PM_WRAITH; else if (mptr->mlet == S_MUMMY && gu.urace.mummynum != NON_PM) u.ugrave_arise = gu.urace.mummynum; - else if (zombie_maker(mtmp) && zombie_form(gy.youmonst.data) != NON_PM) - u.ugrave_arise = zombie_form(gy.youmonst.data); + else if (zombie_maker(mtmp) && gu.urace.zombienum != NON_PM) + u.ugrave_arise = gu.urace.zombienum; else if (mptr->mlet == S_VAMPIRE && Race_if(PM_HUMAN)) u.ugrave_arise = PM_VAMPIRE; else if (mptr == &mons[PM_GHOUL])