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
This commit is contained in:
PatR
2021-07-14 18:29:03 -07:00
parent 938b51c76b
commit 91248a2b7e
3 changed files with 9 additions and 4 deletions

View File

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

View File

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

View File

@@ -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 */
}
}