From: PatR Date: Tue, 11 Jan 2022 18:25:50 +0000 (-0800) Subject: fix recent Wounded_legs fix X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ffeb0e27a8825968a8edbad4a20dc46789cd63e9;p=nethack fix recent Wounded_legs fix 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). --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index cf1725ed4..68cb906c3 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -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 diff --git a/include/youprop.h b/include/youprop.h index a8c6488c8..d004c1d28 100644 --- a/include/youprop.h +++ b/include/youprop.h @@ -123,10 +123,11 @@ /* 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 diff --git a/src/eat.c b/src/eat.c index 621c02a51..d117e0ec3 100644 --- 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))) {