diff --git a/config.lua b/config.lua index 0fd79d3..c7fbfe4 100644 --- a/config.lua +++ b/config.lua @@ -14,7 +14,8 @@ playSounds = true, showFooter = true, refundInvalidMetaname = true, - refundMissingMetaname = true + refundMissingMetaname = true, + refundInsufficentFunds = true }, lang = { footer = "/pay @%name% ", diff --git a/core/ShopState.lua b/core/ShopState.lua index 2524084..663dffa 100644 --- a/core/ShopState.lua +++ b/core/ShopState.lua @@ -134,7 +134,9 @@ amountPurchased = math.min(amountPurchased, purchasedProduct.maxQuantity) end if amountPurchased <= 0 then - refund(transactionCurrency, transaction.from, meta, transaction.value, self.config.lang.refundAtLeastOne, true) + if self.config.settings.refundInsufficentFunds then + refund(transactionCurrency, transaction.from, meta, transaction.value, self.config.lang.refundAtLeastOne, true) + end if self.eventHooks and self.eventHooks.failedPurchase then eventHook.execute(self.eventHooks.failedPurchase, transaction, transactionCurrency, purchasedProduct, self.config.lang.refundAtLeastOne) end