From 91248a2b7eff32147bebb1d72920d124d2658bc6 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 14 Jul 2021 18:29:03 -0700 Subject: [PATCH] fix pull request #548 - encumbrance feedback when polymorphing into "new man". Characteristic stats are shuffled if turning into new man, but when already polymorphed those get overridden by the old pre-polymorph characteristics, resulting in another encumbrance check which might contradict the one that just happened. Skip the encumbrance check done when shuffling stats so that there's only one and it comes after all changes are finished. Fixes #548 --- doc/fixes37.0 | 5 ++++- src/attrib.c | 4 ++-- src/polyself.c | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 84c4982fb..36f7284a4 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.593 $ $NHDT-Date: 1626142353 2021/07/13 02:12:33 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.594 $ $NHDT-Date: 1626312521 2021/07/15 01:28:41 $ General Fixes and Modified Features ----------------------------------- @@ -564,6 +564,9 @@ don't extinguish burning objects when engulfed by a fire vortex allow wishing for a novel via description "paperback book" (previously only worked when specifying "paperback spellbook") deal with gold leaving a shop via scatter() +defer encumbrance check during polymorph to new man; newman() -> redist_attr() + -> encumber_msg() could report change in encumbrance that immediately + became obsolete if polyman() subsequently restored old attributes Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/attrib.c b/src/attrib.c index 911d0ecc5..46398f662 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 attrib.c $NHDT-Date: 1596498149 2020/08/03 23:42:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.75 $ */ +/* NetHack 3.7 attrib.c $NHDT-Date: 1626312521 2021/07/15 01:28:41 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.79 $ */ /* Copyright 1988, 1989, 1990, 1992, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -673,7 +673,7 @@ redist_attr(void) if (ABASE(i) < ATTRMIN(i)) ABASE(i) = ATTRMIN(i); } - (void) encumber_msg(); + /* (void) encumber_msg(); -- caller needs to do this */ } static diff --git a/src/polyself.c b/src/polyself.c index 22e927caa..3c4077499 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 polyself.c $NHDT-Date: 1613600809 2021/02/17 22:26:49 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.160 $ */ +/* NetHack 3.7 polyself.c $NHDT-Date: 1626312523 2021/07/15 01:28:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.162 $ */ /* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ @@ -364,7 +364,9 @@ newman(void) g.killer.format = KILLED_BY_AN; Strcpy(g.killer.name, "unsuccessful polymorph"); done(DIED); + /* must have been life-saved to get here */ newuhs(FALSE); + (void) encumber_msg(); /* used to be done by redist_attr() */ return; /* lifesaved */ } }