The unpaid cost displayed in your inventory now

includes container contents, not just the cost of the
container itself (a prices in inventory phenomenon).

Along the way I discovered a peculiarity -
contained_cost() was adding up the cost of everything in
a container, even if you had stashed items in it that were your
own and not marked unpaid it seems.

I added a flag to force the code to only add objects
that were marked "unpaid" so I could use it in this new
instance, but I didn't change any of
the existing usages (I left the flag at FALSE which leaves
the consideration of the unpaid status alone just as
before).

Some of this is correction of some messages that were
wrong prior to this when dealing with selling of objects
inside a container when only part of the contents was unpaid.
This commit is contained in:
nethack.allison
2002-02-25 19:14:42 +00:00
parent 63908bbed4
commit 24956e3b53
4 changed files with 29 additions and 11 deletions

View File

@@ -1744,7 +1744,7 @@ E int NDECL(dopay);
E boolean FDECL(paybill, (BOOLEAN_P));
E void NDECL(finish_paybill);
E struct obj *FDECL(find_oid, (unsigned));
E long FDECL(contained_cost, (struct obj *,struct monst *,long,BOOLEAN_P));
E long FDECL(contained_cost, (struct obj *,struct monst *,long,BOOLEAN_P, BOOLEAN_P));
E long FDECL(contained_gold, (struct obj *));
E void FDECL(picked_container, (struct obj *));
E long FDECL(unpaid_cost, (struct obj *));