]> granicus.if.org Git - nethack/commitdiff
Don't hardcode min Str in losestr
authorMichael Meyer <me@entrez.cc>
Tue, 4 Oct 2022 22:27:40 +0000 (18:27 -0400)
committerPatR <rankin@nethack.org>
Sat, 8 Oct 2022 23:29:56 +0000 (16:29 -0700)
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).

src/attrib.c

index 8dd57b29140a0ce79d6775562a1803c35e2e0eb1..7684c057c565dd03d063eb0d423d5f1ddb188342 100644 (file)
@@ -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);