fix #H4468 - [no-]autopickup in shop
commit7f8e8293f96e5d31aea8ef914e12db7b4c1f29e3
authorPatR <rankin@nethack.org>
Sat, 6 Aug 2016 02:17:47 +0000 (5 19:17 -0700)
committerPatR <rankin@nethack.org>
Sat, 6 Aug 2016 02:17:47 +0000 (5 19:17 -0700)
tree81c696c7be4563226b17161dc7002b0bb1436dc1
parent694b32cae267134598465ce3d3483483a9dac848
fix #H4468 - [no-]autopickup in shop

Autopickup for pickup_types is disabled for unpaid shop goods, but
always-pick-up autopickup_exception still picked things up, as did
pickup_thrown for thrown objects.  Now they'll only work in shops
for no_charge items (dropped by hero and shk didn't want, or hero
declined to sell).

costly_spot() was being recalculated for every item which passed
pickup_types.  This changes autopickup to check it once for a given
autopickup operation and cache the result.  [Whenever the hero moves,
a room entry check is performed.  That ought to be extended to cache
costly_spot() for <u.ux,u.uy> in iflags or u.]
doc/fixes36.1
src/pickup.c