]> granicus.if.org Git - nethack/commit
fix #U1202 - shop robbery oversights
authornethack.rankin <nethack.rankin>
Sat, 20 Nov 2004 01:41:01 +0000 (01:41 +0000)
committernethack.rankin <nethack.rankin>
Sat, 20 Nov 2004 01:41:01 +0000 (01:41 +0000)
commit6336dbbb65e7dbe37c562021d795bbaed6b86394
treeb42b521236608d6c3d3f687e68113e7552a41e11
parent05923e795f391c81ec56ef563b3661ca9b51ada3
fix #U1202 - shop robbery oversights

     A user reported that when breaking potions inside a box in a shop, he
wasn't charged for them.  The code was calling stolen_value() as intended,
but that routine only charged for types of items which the shop normally
carries.  That meant that breaking the contents of a box in a general
store would charge for them but doing so in a tool shop would, not even
though the tool shopkeeper would gladly sell such things when you picked
them up instead of causing them to go away.

     When fixing this, I noticed that stolen_value() was only charging
for single items.  Most of the time that was right, because throwing and
kicking things always split one off, but there are cases (such as zapping
a wand of teleportation at shop goods) where an entire stack gets stolen
as a group.  This makes stolen_value() handle all quantities.
doc/fixes34.4
src/shk.c