]> granicus.if.org Git - nethack/commitdiff
U665: gold and unpaid containers
authorcohrs <cohrs>
Tue, 23 Sep 2003 22:01:14 +0000 (22:01 +0000)
committercohrs <cohrs>
Tue, 23 Sep 2003 22:01:14 +0000 (22:01 +0000)
The choice was to avoid one of the two sellobj() calls in in_container.
Since I liked the message ordering "put gold into... credit" better than
"credit... put gold into", the code now avoids the 1st sellobj call for coins.

doc/fixes34.3
src/pickup.c

index fba939308a5177da95219f1bf53890f0885b428b..dc745af6caf8253c2b89c5fbb3abf5a02cd82e5e 100644 (file)
@@ -26,6 +26,7 @@ open_levelfile_exclusively() was showing the return value -1 in a panic message,
 it was inappropriate to have a ghost "appear" in desecrated temple when 
        you were blind and without telepathy
 accept wish for "grey spell book" not just "grey spellbook"
+do not double credit when putting gold into an unpaid container
 
 
 Platform- and/or Interface-Specific Fixes
index d6db5730dca50be308714d3123f74e810bee7ffc..e91611888eab0efd390fbf1392a8815e331fe6d8 100644 (file)
@@ -1829,8 +1829,9 @@ register struct obj *obj;
            if (current_container->no_charge && !obj->unpaid) {
                /* don't sell when putting the item into your own container */
                obj->no_charge = 1;
-           } else {
-               /* sellobj() will take an unpaid item off the shop bill */
+           } else if (obj->oclass != COIN_CLASS) {
+               /* sellobj() will take an unpaid item off the shop bill
+                * note: coins are handled later */
                was_unpaid = obj->unpaid ? TRUE : FALSE;
                sellobj_state(SELL_DELIBERATE);
                sellobj(obj, u.ux, u.uy);