Fix pet polyed to long worm staying leashed

Long worms cannot be leashed, but polymorphing a leashed pet
into a long worm kept it leashed.
This commit is contained in:
Pasi Kallinen
2019-11-01 19:05:48 +02:00
parent 6de0f7a939
commit 54024f2015
4 changed files with 6 additions and 1 deletions
+1
View File
@@ -210,6 +210,7 @@ parsing for the argument to 'scores' option was sloppy; "3a/o" (slash) and
wizmakemap could leave genocided monsters on map wizmakemap could leave genocided monsters on map
when entering Astral level, initial rendering of guardian angel didn't show 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 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 Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository
+1
View File
@@ -38,6 +38,7 @@ E int NDECL(number_leashed);
E void FDECL(o_unleash, (struct obj *)); E void FDECL(o_unleash, (struct obj *));
E void FDECL(m_unleash, (struct monst *, BOOLEAN_P)); E void FDECL(m_unleash, (struct monst *, BOOLEAN_P));
E void NDECL(unleash_all); E void NDECL(unleash_all);
E boolean FDECL(leashable, (struct monst *));
E boolean NDECL(next_to_u); E boolean NDECL(next_to_u);
E struct obj *FDECL(get_mleash, (struct monst *)); E struct obj *FDECL(get_mleash, (struct monst *));
E const char *NDECL(beautiful); E const char *NDECL(beautiful);
+1 -1
View File
@@ -595,7 +595,7 @@ unleash_all()
* This ought to exclude various other things, such as lights and gas * This ought to exclude various other things, such as lights and gas
* spore, is_whirly() critters, ethereal creatures, possibly others. * spore, is_whirly() critters, ethereal creatures, possibly others.
*/ */
static boolean boolean
leashable(mtmp) leashable(mtmp)
struct monst *mtmp; struct monst *mtmp;
{ {
+3
View File
@@ -3762,6 +3762,9 @@ boolean msg; /* "The oldmon turns into a newmon!" */
/* take on the new form... */ /* take on the new form... */
set_mon_data(mtmp, mdat); set_mon_data(mtmp, mdat);
if (!leashable(mtmp))
m_unleash(mtmp, TRUE);
if (emits_light(olddata) != emits_light(mtmp->data)) { if (emits_light(olddata) != emits_light(mtmp->data)) {
/* used to give light, now doesn't, or vice versa, /* used to give light, now doesn't, or vice versa,
or light's range has changed */ or light's range has changed */