]> granicus.if.org Git - nethack/commitdiff
fix recent Wounded_legs fix
authorPatR <rankin@nethack.org>
Tue, 11 Jan 2022 18:25:50 +0000 (10:25 -0800)
committerPatR <rankin@nethack.org>
Tue, 11 Jan 2022 18:25:50 +0000 (10:25 -0800)
Wounded_legs was changed from (HWounded_legs || EWounded_legs) to
just (HWounded_legs), but when the timeout code decremented the timer
to 0, HWounded_legs became 0 and heal_legs() operated as if there was
nothing to repair and hero didn't recover from temporarily lost Dex.
Change Wounded_legs back to (HWounded_legs || EWounded_legs).

doc/fixes37.0
include/youprop.h
src/eat.c

index cf1725ed4af2f41270614ecafe001c94305c3b83..68cb906c32e686583c0d1fb5124690ebe57a83d9 100644 (file)
@@ -958,6 +958,9 @@ after changes to gender tracking for corpses and statues, when a unique
        rather than 'historic'
 changing engraving to an occupation resulted in not dulling a weapon used to
        engrave a single character
+a change to wounded legs handling resulted in not recovering lost dexterity
+       or receiving the "leg(s) feel better" message if wound time expired
+       rather than having legs be explicitly healed
 
 curses: 'msg_window' option wasn't functional for curses unless the binary
        also included tty support
index a8c6488c8e07222fe6b429b815e7007944fc3c33..d004c1d28ca6fad52486252c6445820df321640b 100644 (file)
 /* HWounded_legs indicates whether wounded leg(s) condition exists and
    holds the timeout for recovery; EWounded_legs uses the worn-ring bits
    to track left vs right vs both and is meaningless when HWounded_legs
-   is zero; both values apply to steed rather than to hero when riding */
+   is zero except when timeout has just decremented that to 0 and calls
+   heal_legs(); both values apply to steed rather than to hero when riding */
 #define HWounded_legs u.uprops[WOUNDED_LEGS].intrinsic
 #define EWounded_legs u.uprops[WOUNDED_LEGS].extrinsic
-#define Wounded_legs (HWounded_legs) /* (don't include EWounded_legs here) */
+#define Wounded_legs (HWounded_legs || EWounded_legs)
 
 #define HSleepy u.uprops[SLEEPY].intrinsic
 #define ESleepy u.uprops[SLEEPY].extrinsic
index 621c02a51edd5b5165f23cd439daef9f4597042d..d117e0ec3a99647b29af65b296f5b7fe5ed103c8 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -2266,7 +2266,8 @@ fpostfx(struct obj *otmp)
             heal_legs(0);
         break;
     case EGG:
-        if (otmp->corpsenm >= LOW_PM && flesh_petrifies(&mons[otmp->corpsenm])) {
+        if (otmp->corpsenm >= LOW_PM
+            && flesh_petrifies(&mons[otmp->corpsenm])) {
             if (!Stone_resistance
                 && !(poly_when_stoned(g.youmonst.data)
                      && polymon(PM_STONE_GOLEM))) {