Consolidated buy and sell functions of Smith, Witch and Healer
Introducing S_Scroll, S_StartBuy, S_BuyEnter, S_BuItem function and switch between the respective Item Arrays rather than duplicating the functions for each store. Removed the duplicate functions. Wirt is not included as his item is not stored in an array (yet).
This approach works for sell functionality as well, I leave that for a separate commit.
Submitted for sell functions. I'll apply clang-format at the end - it appears to cause lots of whitespace changes.
@joewis Please only apply clang-format to change lines btw
Patching Wirt into the same store logic proves more tricky than expected, of all reasons, because the item in the buy dialogue is offset by 1 item. I leave him be for now.
@obligaron I fixed some issues when rebasing and cleaned up some related code with how stores are refreshed. I actually think it fixes a vanilla bug where after drinking enough exiles to use an item it would still appear as red in the store, but haven't confirmed if that was the case.
I may have introduced some new issues related to the line number logic since stextsel = would be 14/16/18 for different stores that visually appears the same. I don't quite understand why and I think it doesn't really matter as that part should just be discarded in the next rewrite of this code.
I'll try and also get the boy shop merged with the other vendors so that it's all combined.
Adding to the list: Cain now crashes with segfault when attempting to identify items.