From 174cac42a6ba1a74b48191795672112904259359 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 25 Jun 2022 11:26:05 -0700 Subject: [PATCH] partial vampire fix From a followup comment to a reddit post: a vampire who has gained levels loses them when reverting to base form. This fixes the case where it grows into a vampire lord; change the base form from plain vampire to lord when that happens. It does not fix the case where shapechanging to fog or bat or wolf and then back to base form yields a new vampire or vampire lord instead of the one that built itself up. Mainly affects pet vampires since wild oees don't tend to grow very much. --- doc/fixes3-7-0.txt | 3 +++ src/makemon.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index c0240e8ce..6b1696bc8 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -934,6 +934,9 @@ the u.ustuck hierarchy is: swallowed by ustuck, hero poly'd into sticky form could make formerly sticky pold'd hero clear ustuck, leaving hero swallowed by nothing (u.uswallow==1 with u.ustuck==NULL); that could cause a crash if u.ustuck got dereferenced +when a vampire gains levels and grows into a vampire lord, change its cham + field (shapechanger base type) from vampire to vampire lord so that if + it revives in base form it won't revert to plain vampire Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/makemon.c b/src/makemon.c index 426eb9399..d4e85d342 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1963,13 +1963,15 @@ grow_up(struct monst *mtmp, struct monst *victim) an(buf)); } set_mon_data(mtmp, ptr); + if (mtmp->cham == oldtype && is_shapeshifter(ptr)) + mtmp->cham = newtype; /* vampire growing into vampire lord */ newsym(mtmp->mx, mtmp->my); /* color may change */ lev_limit = (int) mtmp->m_lev; /* never undo increment */ mtmp->female = fem; /* gender might be changing */ /* if 'mtmp' is leashed, persistent inventory window needs updating */ if (mtmp->mleashed) - update_inventory(); /* x - leash (attached to a */ + update_inventory(); /* x - leash (attached to a ) */ } /* sanity checks */