]> granicus.if.org Git - nethack/commitdiff
U464 - picking up items while swallowed in a shop
authorcohrs <cohrs>
Wed, 21 May 2003 17:12:47 +0000 (17:12 +0000)
committercohrs <cohrs>
Wed, 21 May 2003 17:12:47 +0000 (17:12 +0000)
The bug report referred to greased hands, but that doesn't affect the
behavior.  If you drop an object while swallowed or engulfed in a shop, and
that object had previously been picked up from the shop floor, the object
was treated as costly.  In some cases, this could result in impossible
errors later on.  Perhaps object ox & oy should be modified when in
player/monster inventory, but this fix addresses the specific problem by
not doing the costly check while swallowed.

doc/fixes34.2
src/pickup.c

index eabb25d5cb4e8fa1c8f4eb472c50309c9c6dab24..1e503d048c779716c13103f726eecbadba5b9591 100644 (file)
@@ -71,6 +71,7 @@ ensure proper message ordering for boulder trap messages
 clean up data set by join_map that is overlaid by MAPs on special levels
 clarify disclose option default in opthelp, and support "all" as old help said
 add more calls to update_inventory as the inventory changes
+don't charge for items picked up from monster's interior while swallowed
 
 
 Platform- and/or Interface-Specific Fixes
index af65ffbefb79631df2922121d09733e2254baa26..55414691e31c63313eaaa527689c06885e117368 100644 (file)
@@ -1302,8 +1302,8 @@ boolean telekinesis;      /* not picking it up directly by hand */
 }
 
 /*
- * Do the actual work of picking otmp from the floor and putting
- * it in the hero's inventory.  Take care of billing.  Return a
+ * Do the actual work of picking otmp from the floor or monster's interior
+ * and putting it in the hero's inventory.  Take care of billing.  Return a
  * pointer to the object where otmp ends up.  This may be different
  * from otmp because of merging.
  *
@@ -1314,7 +1314,7 @@ pick_obj(otmp)
 struct obj *otmp;
 {
        obj_extract_self(otmp);
-       if (otmp != uball && costly_spot(otmp->ox, otmp->oy)) {
+       if (!u.uswallow && otmp != uball && costly_spot(otmp->ox, otmp->oy)) {
            char saveushops[5], fakeshop[2];
 
            /* addtobill cares about your location rather than the object's;