forked from 2009Scape/Server
Fixed bug where trying to buy-x too many items from a shop would not fill available inventory slots
This commit is contained in:
parent
f29d7e37de
commit
c23c7d0617
1 changed files with 2 additions and 0 deletions
|
|
@ -258,6 +258,8 @@ class Shop(val title: String, val stock: Array<ShopItem>, val general: Boolean =
|
|||
val item = Item(inStock.id, amount)
|
||||
if(inStock.amount < amount)
|
||||
item.amount = inStock.amount
|
||||
if (item.amount > player.inventory.getMaximumAdd(item))
|
||||
item.amount = player.inventory.getMaximumAdd(item)
|
||||
|
||||
if(inStock.amount == 0) {
|
||||
sendMessage(player, "This item is out of stock.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue