From: Pasi Kallinen Date: Tue, 22 Dec 2015 20:36:27 +0000 (+0200) Subject: Do not autopickup unpaid items in shops X-Git-Tag: NetHack-3.6.1_RC01~1128 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91a7d393cd7ebf179ea5cc06f584cadd828912c1;p=nethack Do not autopickup unpaid items in shops This is overridden by pickup_thrown and autopickup exceptions. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index c71710f43..5fea268c6 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -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 diff --git a/src/pickup.c b/src/pickup.c index 34fcf59e6..df29ba7c3 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -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);