Fixed bug where trying to buy-x too many items from a shop would not fill available inventory slots
This commit is contained in:
@@ -258,6 +258,8 @@ class Shop(val title: String, val stock: Array<ShopItem>, val general: Boolean =
|
|||||||
val item = Item(inStock.id, amount)
|
val item = Item(inStock.id, amount)
|
||||||
if(inStock.amount < amount)
|
if(inStock.amount < amount)
|
||||||
item.amount = inStock.amount
|
item.amount = inStock.amount
|
||||||
|
if (item.amount > player.inventory.getMaximumAdd(item))
|
||||||
|
item.amount = player.inventory.getMaximumAdd(item)
|
||||||
|
|
||||||
if(inStock.amount == 0) {
|
if(inStock.amount == 0) {
|
||||||
sendMessage(player, "This item is out of stock.")
|
sendMessage(player, "This item is out of stock.")
|
||||||
|
|||||||
Reference in New Issue
Block a user