rscplus
rscplus copied to clipboard
Store item id selected before item disappears from shop stock during sell-x dialogue
We could store the reference to item ID selected when the Sell-X dialogue box is summoned, then just always use that last-selected-item when the packet is sent. This way the user would not have their input discarded.
Related to authentic bug #64, fixed in PR #68.
For reference on anyone taking look into enhancement, also should be considered case for Buy-x
Technically Buy-X might be possible to trigger, but the setup for that is much rarer.
- has to be an item that store doesn't have any base stock of, because otherwise the index won't disappear, the shop just says "has 0"
- player starts buying "x" of item they would not normally expect in the store
- all stock is depleted!
- stock is replenished by a second player in time for the buy-x to make sense again (if step 4 doesn't happen, then current behaviour is fine, because it just exits gracefully)
- send the buy-x with the last selected item id
Set up for sell-x:
- sell a few of an item to shop that they don't normally stock
- realize you actually need to sell quite a few, sell-X
- shop despawns quick & the item id gets set to -1
- send the sell-x with the last selected item id