From c23c7d06178383e6fda37df778659c54766b9978 Mon Sep 17 00:00:00 2001 From: Ceikry Date: Wed, 29 Jun 2022 12:29:37 +0000 Subject: [PATCH] Fixed bug where trying to buy-x too many items from a shop would not fill available inventory slots --- Server/src/main/kotlin/rs09/game/content/global/shops/Shop.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Server/src/main/kotlin/rs09/game/content/global/shops/Shop.kt b/Server/src/main/kotlin/rs09/game/content/global/shops/Shop.kt index 764d62e34..b17e7ca78 100644 --- a/Server/src/main/kotlin/rs09/game/content/global/shops/Shop.kt +++ b/Server/src/main/kotlin/rs09/game/content/global/shops/Shop.kt @@ -258,6 +258,8 @@ class Shop(val title: String, val stock: Array, 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.")