From 5902acef642c829c67de9a546b2a1585ae74937f Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 4 Oct 2022 15:03:35 -0700 Subject: [PATCH] github issue #890 - hobbit #chat feedback Issue reported by eakaye: the alternate hobbit chat message is a complaint about dungeon conditions, given if its current HP is 10 or more less than its maximum HP. But since hobbits are level 1, they will almost never have 10 HP so won't be alive to chat when at max minus 10. Keep the old behavior if maximum happens to be more than 10, but give alternate feedback when less than max if max is 10 or less. Fixes #890 --- src/sounds.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/sounds.c b/src/sounds.c index fdecb5c565..9369d0c58a 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 sounds.c $NHDT-Date: 1600933442 2020/09/24 07:44:02 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.103 $ */ +/* NetHack 3.7 sounds.c $NHDT-Date: 1664920994 2022/10/04 22:03:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.123 $ */ /* Copyright (c) 1989 Janet Walz, Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ @@ -949,10 +949,15 @@ domonnoise(register struct monst* mtmp) else switch (monsndx(ptr)) { case PM_HOBBIT: - pline_msg = - (mtmp->mhpmax - mtmp->mhp >= 10) - ? "complains about unpleasant dungeon conditions." - : "asks you about the One Ring."; + /* 3.7: the 'complains' message used to be given if the + hobbit's current hit points were at 10 below max or + less, but their max is normally less than 10 so it + would almost never occur */ + pline_msg = (mtmp->mhp < mtmp->mhpmax + && (mtmp->mhpmax <= 10 + || mtmp->mhp <= mtmp->mhpmax - 10)) + ? "complains about unpleasant dungeon conditions." + : "asks you about the One Ring."; break; case PM_ARCHEOLOGIST: pline_msg =