]> granicus.if.org Git - nethack/commitdiff
fix pull request #541 - itemized shop billing
authorPatR <rankin@nethack.org>
Sat, 3 Jul 2021 01:52:17 +0000 (18:52 -0700)
committerPatR <rankin@nethack.org>
Sat, 3 Jul 2021 01:52:17 +0000 (18:52 -0700)
when perm_invent is displayed.  The persistent inventory window
showed unpaid items with their prices, but when using itemized
billing those prices went away when an item was purchased.

The prices and item-by-item prompting continued correctly with
remaining unpaid items; only the perm_invent display was affected.

Fixes #541

doc/fixes37.0
src/shk.c

index 700efcd76b3caa4cc798a111792527a4b6d96fd2..ebaa48d672e9ad3cce297ad23b8654fab1b8cc40 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.578 $ $NHDT-Date: 1624656533 2021/06/25 21:28:53 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.581 $ $NHDT-Date: 1625277130 2021/07/03 01:52:10 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -548,8 +548,11 @@ using a bullwhip to snatch a wielded cockatrice corpse from a monster when not
 make fire-command autowield an appropriate launcher and add fireassist boolean
        option to toggle the assistance off
 Angels and priests were always described as "the {Angel,priest,high priest} of
-       <deity>" when first two should have been "{an Angel,a high priest}..."
+       <deity>" when first two should have been "{an Angel,a priest}..."
 shopkeepers can remove pits and webs
+perm_invent: when buying shop goods using itemized purchasing while persistent
+       inventory window was enabled, the prices of unpaid items went away as
+       soon as any item was bought (actual item-by-item purchase worked ok)
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index e2caffee3234b369cf638c35385a808e92bb0e66..b0cc791dc1e612642f6318a4b1d632aa0648599e 100644 (file)
--- a/src/shk.c
+++ b/src/shk.c
@@ -1,4 +1,4 @@
-/* NetHack 3.7 shk.c   $NHDT-Date: 1620861209 2021/05/12 23:13:29 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.197 $ */
+/* NetHack 3.7 shk.c   $NHDT-Date: 1625277130 2021/07/03 01:52:10 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.202 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2012. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1621,6 +1621,8 @@ dopayobj(
                   ltmp, "");
     obj->quan = save_quan; /* restore original count */
     /* quan => amount just bought, save_quan => remaining unpaid count */
+
+    iflags.suppress_price--; /* before update_inventory() below */
     if (consumed) {
         if (quan != bp->bquan) {
             /* eliminate used-up portion; remainder is still unpaid */
@@ -1634,9 +1636,9 @@ dopayobj(
             dealloc_obj(obj);
             *obj_p = 0; /* destroy pointer to freed object */
         }
-    } else if (itemize)
+    } else if (itemize) {
         update_inventory(); /* Done just once in dopay() if !itemize. */
-    iflags.suppress_price--;
+    }
     return buy;
 }