]> granicus.if.org Git - nethack/commitdiff
fix pull request #548 - encumbrance feedback
authorPatR <rankin@nethack.org>
Thu, 15 Jul 2021 01:29:03 +0000 (18:29 -0700)
committerPatR <rankin@nethack.org>
Thu, 15 Jul 2021 01:29:03 +0000 (18:29 -0700)
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
src/attrib.c
src/polyself.c

index 84c4982fb779d1bb0cd9b2a2afebb856cdd365d3..36f7284a4ac637a4232b9fc795f6d78986ba0ebd 100644 (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
index 911d0ecc571fea7d78e145ed4974586c39bad91c..46398f66249610bd97a7cd45ceb6eaeadb1b0396 100644 (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
index 22e927caa8b6dc557a9b67b845aa3ba9333c3f77..3c4077499e008b0307f4783c87461a31c1b004bd 100644 (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 */
         }
     }