]> granicus.if.org Git - nethack/commit
fix #H7103 - shop pricing
authorPatR <rankin@nethack.org>
Thu, 27 Dec 2018 22:12:48 +0000 (14:12 -0800)
committerPatR <rankin@nethack.org>
Thu, 27 Dec 2018 22:12:48 +0000 (14:12 -0800)
commita6b432203449bcdba546730e69e5d1946d448e22
treea107b71c604593104cc61c464148d7a69a9f5351
parentf8b4ad3fdc682e8e70633d761383121e7aa41e27
fix #H7103 - shop pricing

Player came across a stack of 2 gray stones in a shop and kicked one.
That one ended up with a different (in his case, lower) price once it
was separate.  This behavior only applies to non-glass gems which add
a price variation derived from internal ID (obj->o_id) number.  Make
splitting stacks always yield the same price per item in the new stack
as was being charged in the old stack by choosing a similar o_id.  Do
it for all splits (that can vary price by ID, so just non-glass gems),
not just ones performed inside shops.

He picked up the lower priced one and dropped it back on the original
higher priced one; the combined stack took on the lower price.  That
will no longer happen if they come from splitting a stack, but this
fix doesn't address merging with different prices when they start out
as separate stacks.  (Unpaid items won't merge in inventory if prices
are different, but shop-owned items will merge on floor.)
doc/fixes36.2
include/extern.h
src/mkobj.c
src/shk.c