]> granicus.if.org Git - nethack/commitdiff
B05001 - eating a tin in a stack on the floor
authorcohrs <cohrs>
Sat, 19 Jul 2003 03:29:21 +0000 (03:29 +0000)
committercohrs <cohrs>
Sat, 19 Jul 2003 03:29:21 +0000 (03:29 +0000)
Make sure to splitobj tin.tin before calling bill_dummy_object.
Avoids charging to all the stacked tins when you eat the 1st one.

doc/fixes34.2
src/eat.c

index 6945d9ca0a72c9e3813b14aa1a95a3e78eedb059..9bdee7ca371cb68b7d30dd0711f519eac3f235e6 100644 (file)
@@ -105,6 +105,7 @@ try to keep saddle at the same location as the steed corpse
 never display I symbol on the mounted hero/steed location
 pit digging is no longer stopped by a sleeping monster next to you
 ensure mksobj() always attaches timer to corpse, even if called with init FALSE
+only charge for eating one stacked tin, not all at once
 
 
 Platform- and/or Interface-Specific Fixes
index 8783871ea246dc72a669e65a8a318f0406982a92..79e235a882693fdef3b5847b0fc871c0b41b5a57 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -1057,6 +1057,8 @@ opentin()         /* called during each move whilst opening a tin */
                 !tin.tin->no_charge)
                || tin.tin->unpaid)) {
                verbalize("You open it, you bought it!");
+               /* charge for one at pre-eating cost */
+               if(tin.tin->quan > 1L) tin.tin = splitobj(tin.tin, 1L);
                bill_dummy_object(tin.tin);
            }
 
@@ -1090,6 +1092,8 @@ opentin()         /* called during each move whilst opening a tin */
                 !tin.tin->no_charge)
                || tin.tin->unpaid)) {
                verbalize("You open it, you bought it!");
+               /* charge for one at pre-eating cost */
+               if(tin.tin->quan > 1L) tin.tin = splitobj(tin.tin, 1L);
                bill_dummy_object(tin.tin);
            }