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:04:24 +02:00
parent 6de0f7a939
commit 54024f2015
4 changed files with 6 additions and 1 deletions

View File

@@ -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;
{

View File

@@ -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 */