]> granicus.if.org Git - nethack/commitdiff
Do not autopickup unpaid items in shops
authorPasi Kallinen <paxed@alt.org>
Tue, 22 Dec 2015 20:36:27 +0000 (22:36 +0200)
committerPasi Kallinen <paxed@alt.org>
Tue, 22 Dec 2015 20:36:30 +0000 (22:36 +0200)
This is overridden by pickup_thrown and autopickup
exceptions.

doc/fixes36.1
src/pickup.c

index c71710f43cf5f6a5c6747083a18b52f0c1e9333e..5fea268c6ccbd95d94a859e741f2ea294989b207 100644 (file)
@@ -53,6 +53,7 @@ dipping fruit juice into enlightenment gave different result than the inverse
 make travel walk up to a trap and stop when the trap blocks the only
        way forward, instead of trying to go straight line
 travel will displace pets rather than stop
+do not autopickup unpaid items in shops
 
 
 Platform- and/or Interface-Specific Fixes
index 34fcf59e6186aa7b16dbe8492851cf5680b9f42c..df29ba7c36dcd73d64c84ebb0e36b18e097568b9 100644 (file)
@@ -720,7 +720,12 @@ menu_item **pick_list; /* list of objects and counts to pick up */
 
     /* first count the number of eligible items */
     for (n = 0, curr = olist; curr; curr = FOLLOW(curr, follow)) {
-        pickit = (!*otypes || index(otypes, curr->oclass));
+        /* pick if in pickup_types and not unpaid item in shop */
+        pickit = ((!*otypes || index(otypes, curr->oclass))
+                  && !(curr->where == OBJ_FLOOR
+                       && !curr->no_charge
+                       && isok(curr->ox, curr->oy)
+                       && costly_spot(curr->ox, curr->oy)));
         /* check for "always pick up */
         if (!pickit)
             pickit = is_autopickup_exception(curr, TRUE);