]> granicus.if.org Git - nethack/commitdiff
U337 - putting gold in a shop container
authorcohrs <cohrs>
Mon, 17 Mar 2003 05:38:36 +0000 (05:38 +0000)
committercohrs <cohrs>
Mon, 17 Mar 2003 05:38:36 +0000 (05:38 +0000)
When you drop a container in a shop, gold in that container is added to
your credit.  However, if you put gold into a container after it was already
on the shop floor, no credit was given.  Then when you picked up the bag or
tried to take out the gold, you'd be debited for it.  This change causes
in_container to handle gold the same as container dropping does.

doc/fixes34.2
src/pickup.c

index 1798547c76519b92f898f396259043ee182e7754..f23b53c34d8cc1c03cb24966dd3339a928d5fea3 100644 (file)
@@ -18,6 +18,8 @@ perform artifact touch checks when putting on accessories
 missing noun in message when horns pierce through your helmet
 don't use hcolor() for trapped chest gases when you aren't hallucinating
 the age of a potion of oil from a bones file wasn't being handled correctly
+putting gold in a container on the shop floor wasn't credited the way
+       gold already in the container when dropped was credited
 
 
 Platform- and/or Interface-Specific Fixes
@@ -38,4 +40,3 @@ win32tty: keystroke handlers can be dynamically loaded to assist in resolving
        internationalization issues
 
 
-
index 351b8e8627aef5deb98dc9d073ae61e534d80e53..07ac3228df9b0617368d4fe0de9ce77fb8cb5779 100644 (file)
@@ -1802,6 +1802,9 @@ register struct obj *obj;
            Strcpy(buf, the(xname(current_container)));
            You("put %s into %s.", doname(obj), buf);
 
+           /* gold in container always needs to be added to credit */
+           if (floor_container && obj->oclass == COIN_CLASS)
+               sellobj(obj, current_container->ox, current_container->oy);
            (void) add_to_container(current_container, obj);
            current_container->owt = weight(current_container);
        }