]> granicus.if.org Git - nethack/commitdiff
potion dipping tweak
authorPatR <rankin@nethack.org>
Sun, 7 Feb 2021 00:34:41 +0000 (16:34 -0800)
committerPatR <rankin@nethack.org>
Sun, 7 Feb 2021 00:34:41 +0000 (16:34 -0800)
Update some code from four weeks ago.  One of two hold_potion()
calls was followed by update_inventory() but the other wasn't.
Have hold_potion() do that itself.  I'm not sure that this is
needed and haven't convinced myself that it's not.

src/potion.c

index 167ccb2d5f6c2043ffffd1fbf2edebb5803c9729..e8cb131bd7e76f8d7c3c92beedb91fe36ddc479a 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 potion.c        $NHDT-Date: 1610410780 2021/01/12 00:19:40 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.190 $ */
+/* NetHack 3.7 potion.c        $NHDT-Date: 1612658075 2021/02/07 00:34:35 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.193 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2013. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1901,6 +1901,7 @@ hold_potion(struct obj *potobj, const char *drop_fmt, const char *drop_arg,
     /* re-insert into inventory, possibly merging with compatible stack */
     potobj = hold_another_object(potobj, drop_fmt, drop_arg, hold_msg);
     flags.pickup_burden = save_pickup_burden;
+    update_inventory();
     return;
 }
 
@@ -2301,7 +2302,6 @@ dodip(void)
            with compatible ones; override 'pickup_burden' while doing so */
         hold_potion(singlepotion, "You juggle and drop %s!",
                     doname(singlepotion), (const char *) 0);
-        update_inventory();
         return 1;
     }