fix? github issue #1431 - init_role_redist()

Issue reported by vultur-cadens:  3.7's revised handling for initial
characteristic allocation included an unintended change from 3.6's.

I don't pretend to understand how characteristic allocation really
works.  This should restore handling for values which are too low.

Fixes #1431
This commit is contained in:
PatR
2025-08-11 15:28:11 -07:00
parent 407a2e0ea8
commit 351ed094b4

View File

@@ -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;
}