fix #2382 - temp Dex loss becomes permanent when dismounting

From a bug report, if you dismount
from a steed whose legs are wounded, you won't recover the point of
dexterity which was removed when they becme injured.  He noticed the
case where the steed had just died, but it happens for voluntary
dismount too (actually any dismount except one which wounds the hero's
legs in the process:  DISMOUNT_THROWN or DISMOUNT_FELL).

     It seems rather odd that the hero temporarily loses Dex when the
steed becomes injured, but I haven't changed that.
This commit is contained in:
nethack.rankin
2011-07-16 03:41:46 +00:00
parent 6a53009069
commit edaa9440b7
3 changed files with 38 additions and 21 deletions

View File

@@ -1,5 +1,4 @@
/* NetHack 3.5 do.c $Date$ $Revision$ */
/* SCCS Id: @(#)do.c 3.5 2008/01/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1678,7 +1677,7 @@ register int timex;
void
heal_legs()
{
if(Wounded_legs) {
if (Wounded_legs) {
if (ATEMP(A_DEX) < 0) {
ATEMP(A_DEX)++;
context.botl = 1;
@@ -1688,18 +1687,29 @@ heal_legs()
if (!u.usteed)
#endif
{
/* KMH, intrinsics patch */
if((EWounded_legs & BOTH_SIDES) == BOTH_SIDES) {
Your("%s feel somewhat better.",
makeplural(body_part(LEG)));
} else {
Your("%s feels somewhat better.",
body_part(LEG));
}
const char *legs = body_part(LEG);
if ((EWounded_legs & BOTH_SIDES) == BOTH_SIDES)
legs = makeplural(legs);
/* this used to say "somewhat better" but that was
misleading since legs are being fully healed */
Your("%s %s better.", legs, vtense(legs, "feel"));
}
HWounded_legs = EWounded_legs = 0;
/* Wounded_legs reduces carrying capacity, so we want
an encumbrance check when they're healed. However,
while dismounting, first steed's legs get healed,
then hero is dropped to floor and a new encumbrance
check is made [in dismount_steed()]. So don't give
encumbrance feedback during the dismount stage
because it could seem to be shown out of order and
it might be immediately contradicted [able to carry
more when steed becomes healthy, then possible floor
feedback, then able to carry less when back on foot]. */
if (!in_steed_dismounting) (void)encumber_msg();
}
(void)encumber_msg();
}
/*do.c*/