lifesaved steed (trunk only)

From the newsgroup:  hero's steed can become untame if killed while
it is wearing an amulet of life saving, leaving the hero still mounted
and resulting in repeated "placing steed onto map?" warnings when the
steed tries to move.  Force the hero to be thrown off the mount in that
situation.
This commit is contained in:
nethack.rankin
2008-11-24 23:35:33 +00:00
parent 4b1116f4d0
commit 624df671c6
3 changed files with 23 additions and 14 deletions

View File

@@ -1481,6 +1481,7 @@ STATIC_OVL void
lifesaved_monster(mtmp)
struct monst *mtmp;
{
boolean surviver;
struct obj *lifesave = mlifesaver(mtmp);
if (lifesave) {
@@ -1504,19 +1505,21 @@ struct monst *mtmp;
pline_The("medallion crumbles to dust!");
}
m_useup(mtmp, lifesave);
surviver = !(mvitals[monsndx(mtmp->data)].mvflags & G_GENOD);
mtmp->mcanmove = 1;
mtmp->mfrozen = 0;
if (mtmp->mtame && !mtmp->isminion) {
wary_dog(mtmp, FALSE);
wary_dog(mtmp, !surviver);
}
if (mtmp->mhpmax <= 0) mtmp->mhpmax = 10;
mtmp->mhp = mtmp->mhpmax;
if (mvitals[monsndx(mtmp->data)].mvflags & G_GENOD) {
if (cansee(mtmp->mx, mtmp->my))
pline("Unfortunately %s is still genocided...",
mon_nam(mtmp));
} else
return;
if (surviver) return;
/* genocided monster can't be life-saved */
if (cansee(mtmp->mx, mtmp->my))
pline("Unfortunately, %s is still genocided...",
mon_nam(mtmp));
}
mtmp->mhp = 0;
}