From 351ed094b4e499435847f9ef21e145061a0c67fd Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 11 Aug 2025 15:28:11 -0700 Subject: [PATCH] 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 --- src/attrib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; }