angband/angband — pull request #245 by seebs (2013-05-19 22:15:37+00:00)
Title: Fix store.c to correct the bugs I introduced.

First, there was a missing break; in the setup for the general store
to align it with how other stores behave, so it would accept only
things that were on both its list and the armory's list. Whoops.

Secondly, tweak the staple good creation a bit, with the goal being that
stores always have a full stack of their *actual* staple goods -- not
other kinds.

Changes for that:
* store_find_kind returns a pointer to the found object, or NULL.
* store_find_kind does not accept ego items. So, for instance, an
everburning torch isn't "a torch".
* If a stack is found, the stack's size is reset forcibly to 40.
* Otherwise a new stack is created. Of 40.

No store has a staple item which it buys, and which has magic but non-ego
varieties. (You can't sell arrows to the general store, there's no enchanted
non-ego spellbooks or scrolls of phase door; lights were the only broken
case.)