]> granicus.if.org Git - nethack/commitdiff
partial vampire fix
authorPatR <rankin@nethack.org>
Sat, 25 Jun 2022 18:26:05 +0000 (11:26 -0700)
committerPatR <rankin@nethack.org>
Sat, 25 Jun 2022 18:26:05 +0000 (11:26 -0700)
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
src/makemon.c

index c0240e8ce9959d234645bebb13c430db0bbca3ef..6b1696bc898547e4282fc3480615b1fb4bfccaf4 100644 (file)
@@ -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
index 426eb93990c0913f2570bb7be1dfd3f00906ac8b..d4e85d3423d98d693ffa278dc251baf29da0ed1b 100644 (file)
@@ -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 <mon> */
+            update_inventory(); /* x - leash (attached to a <mon>) */
     }
 
     /* sanity checks */