From: Michael Meyer Date: Tue, 4 Oct 2022 22:27:40 +0000 (-0400) Subject: Don't hardcode min Str in losestr X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b80cf6138c4efc8c5a4d52159e5e4ea629085b1a;p=nethack Don't hardcode min Str in losestr Min Str is typically 3 no matter the hero's race, but could be higher (at least in theory?). Using ATTRMIN makes losestr respect the same minimum as other kinds of attribute loss (I'm operating under the assumption that this wasn't an intentional move to fix the minimum at 3 regardless of other factors). --- diff --git a/src/attrib.c b/src/attrib.c index 8dd57b291..7684c057c 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -222,7 +222,7 @@ losestr(int num, const char *knam, schar k_format) k_format = KILLED_BY; } - while (ustr < 3) { + while (ustr < ATTRMIN(A_STR)) { ++ustr; --num; losehp(6, knam, k_format);