diff --git a/src/attrib.c b/src/attrib.c index 079607c1b..fc6a7aebf 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 attrib.c $NHDT-Date: 1726168587 2024/09/12 19:16:27 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.129 $ */ +/* NetHack 3.7 attrib.c $NHDT-Date: 1754979443 2025/08/11 22:17:23 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.134 $ */ /* Copyright 1988, 1989, 1990, 1992, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -701,7 +701,9 @@ init_attr_role_redist(int np, boolean addition) while ((addition ? (np > 0) : (np < 0)) && tryct < 100) { int i = rnd_attr(); - if (i >= A_MAX || ABASE(i) >= ATTRMAX(i)) { + if (i >= A_MAX + || (addition ? (ABASE(i) >= ATTRMAX(i)) + : (ABASE(i) <= ATTRMIN(i)))) { tryct++; continue; }