unleashing untame monsters

Fix several cases that earlier patches didn't address.
If a leashed monster becomes untame, detach the leash.
This commit is contained in:
nethack.rankin
2002-03-11 08:46:54 +00:00
parent afae7f931c
commit 085498ba28
4 changed files with 32 additions and 17 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)steed.c 3.4 2001/04/12 */
/* SCCS Id: @(#)steed.c 3.4 2002/03/09 */
/* Copyright (c) Kevin Hugo, 1998-1999. */
/* NetHack may be freely redistributed. See license for details. */
@@ -272,8 +272,11 @@ mount_steed(mtmp, force)
return (FALSE);
}
if (!force && !Role_if(PM_KNIGHT) && !(--mtmp->mtame)) {
/* no longer tame */
newsym(mtmp->mx, mtmp->my);
pline("%s resists!", Monnam(mtmp));
pline("%s resists%s!", Monnam(mtmp),
mtmp->mleashed ? " and its leash comes off" : "");
if (mtmp->mleashed) m_unleash(mtmp, FALSE);
return (FALSE);
}
if (!force && Underwater && !is_swimmer(ptr)) {
@@ -385,6 +388,7 @@ kick_steed()
/* Make the steed less tame and check if it resists */
if (u.usteed->mtame) u.usteed->mtame--;
if (!u.usteed->mtame && u.usteed->mleashed) m_unleash(u.usteed, TRUE);
if (!u.usteed->mtame || (u.ulevel+u.usteed->mtame < rnd(MAXULEV/2+5))) {
newsym(u.usteed->mx, u.usteed->my);
dismount_steed(DISMOUNT_THROWN);