]> granicus.if.org Git - nethack/commitdiff
'Du' bug with non-empty containers
authorPatR <rankin@nethack.org>
Fri, 29 May 2015 22:46:13 +0000 (15:46 -0700)
committerPatR <rankin@nethack.org>
Fri, 29 May 2015 22:46:13 +0000 (15:46 -0700)
ckunpaid() had the same coding error as allow_category().  A hero-owned
container holding hero-owned contents followed in invent an any unpaid
object was mis-classified unpaid.

src/invent.c

index 59f73cdfb4aeef4050a25eb2f8fad2d49ab3db3e..cb4396d25c89e1cd32d2a7a0ae89878a2b71223e 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 invent.c        $NHDT-Date: 1432512763 2015/05/25 00:12:43 $  $NHDT-Branch: master $:$NHDT-Revision: 1.164 $ */
+/* NetHack 3.6 invent.c        $NHDT-Date: 1432939569 2015/05/29 22:46:09 $  $NHDT-Branch: master $:$NHDT-Revision: 1.166 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1337,7 +1337,7 @@ STATIC_PTR int
 ckunpaid(otmp)
 register struct obj *otmp;
 {
-    return (otmp->unpaid || (Has_contents(otmp) && count_unpaid(otmp)));
+    return (otmp->unpaid || (Has_contents(otmp) && count_unpaid(otmp->cobj)));
 }
 
 boolean