diff --git a/doc/fixes36.3 b/doc/fixes36.3 index c95a46c4c..4738aa857 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -210,6 +210,7 @@ parsing for the argument to 'scores' option was sloppy; "3a/o" (slash) and wizmakemap could leave genocided monsters on map when entering Astral level, initial rendering of guardian angel didn't show it as tame; noticeable if the level was entered with 'hilite_pet' On +fix a leashed pet polymorphed into a long worm staying leashed Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository diff --git a/include/extern.h b/include/extern.h index 50d25cc1e..b1a28d4b8 100644 --- a/include/extern.h +++ b/include/extern.h @@ -38,6 +38,7 @@ E int NDECL(number_leashed); E void FDECL(o_unleash, (struct obj *)); E void FDECL(m_unleash, (struct monst *, BOOLEAN_P)); E void NDECL(unleash_all); +E boolean FDECL(leashable, (struct monst *)); E boolean NDECL(next_to_u); E struct obj *FDECL(get_mleash, (struct monst *)); E const char *NDECL(beautiful); diff --git a/src/apply.c b/src/apply.c index 63ffe9e6f..96f9469b6 100644 --- a/src/apply.c +++ b/src/apply.c @@ -595,7 +595,7 @@ unleash_all() * This ought to exclude various other things, such as lights and gas * spore, is_whirly() critters, ethereal creatures, possibly others. */ -static boolean +boolean leashable(mtmp) struct monst *mtmp; { diff --git a/src/mon.c b/src/mon.c index 8f9de1f4a..9b734d0db 100644 --- a/src/mon.c +++ b/src/mon.c @@ -3762,6 +3762,9 @@ boolean msg; /* "The oldmon turns into a newmon!" */ /* take on the new form... */ set_mon_data(mtmp, mdat); + if (!leashable(mtmp)) + m_unleash(mtmp, TRUE); + if (emits_light(olddata) != emits_light(mtmp->data)) { /* used to give light, now doesn't, or vice versa, or light's range has changed */