Fixed a bug when buying items from shops with a full inventory

This commit is contained in:
Ceikry
2022-12-20 08:40:59 +00:00
committed by Ryan
parent 7750471015
commit b387e993bb
2 changed files with 25 additions and 0 deletions
@@ -290,6 +290,9 @@ class Shop(val title: String, val stock: Array<ShopItem>, val general: Boolean =
{
if(removeItem(player, cost))
{
if (item.amount == 0 && amountInInventory(player, cost.id) == 0) {
item.amount = 1
}
if(!hasSpaceFor(player, item)) {
addItem(player, cost.id, cost.amount)
sendMessage(player, "You don't have enough inventory space to buy that many.")