fix #K3496 - leash description when pet changes

If persistent inventory is displayed and contains an entry for a leash
attached to a pet and the pet's type or name changes, the perm_invent
window didn't get updated to reflect the new leash information:
 x - leash (attached to <mon>)
Report was for polymorph but applied to growing into bigger form and
to being (re-/un-)christened as well.
This commit is contained in:
PatR
2021-12-19 09:30:07 -08:00
parent 5f98102e73
commit 7ccc195155
4 changed files with 18 additions and 2 deletions

View File

@@ -1107,6 +1107,9 @@ christen_monst(struct monst *mtmp, const char *name)
new_mgivenname(mtmp, lth); /* removes old name if one is present */
if (lth)
Strcpy(MGIVENNAME(mtmp), name);
/* if 'mtmp' is leashed, persistent inventory window needs updating */
if (mtmp->mleashed)
update_inventory(); /* x - leash (attached to Fido) */
return mtmp;
}