diff --git a/components/ConfigEditor.lua b/components/ConfigEditor.lua index 652eda6..524976b 100644 --- a/components/ConfigEditor.lua +++ b/components/ConfigEditor.lua @@ -56,8 +56,9 @@ if subConfig[path] then subConfig = subConfig[path] else - subConfig[path] = {} - subConfig = subConfig[path] + --subConfig[path] = {} + --subConfig = subConfig[path] + subConfig = {} end if subSchema[path] then subSchema = subSchema[path] @@ -67,8 +68,9 @@ elseif subSchema.__type and subSchema.__type:sub(1,5) == "array" and subSchema.__entry then subSchema = subSchema.__entry else - subSchema[path] = {} - subSchema = subSchema[path] + --subSchema[path] = {} + --subSchema = subSchema[path] + subSchema = {} end table.insert(paths, path) end diff --git a/config.lua b/config.lua index c1cfe32..9ce1846 100644 --- a/config.lua +++ b/config.lua @@ -12,6 +12,7 @@ smallTextKristPayCompatability = true, playSounds = true, showFooter = true, + refundInvalidMetaname = true, }, lang = { footer = "/pay @%name% ", diff --git a/configDefaults.lua b/configDefaults.lua index c69a4ac..0c1cd59 100644 --- a/configDefaults.lua +++ b/configDefaults.lua @@ -11,6 +11,7 @@ smallTextKristPayCompatability = true, playSounds = true, showFooter = true, + refundInvalidMetaname = true, }, lang = { footer = "/pay @%name% ", diff --git a/core/ShopState.lua b/core/ShopState.lua index 31a45c2..d9f69d5 100644 --- a/core/ShopState.lua +++ b/core/ShopState.lua @@ -177,7 +177,9 @@ end end else - refund(transactionCurrency, transaction.from, meta, transaction.value, state.config.lang.refundInvalidProduct, true) + if state.config.settings.refundInvalidMetaname then + refund(transactionCurrency, transaction.from, meta, transaction.value, state.config.lang.refundInvalidProduct, true) + end if state.eventHooks and state.eventHooks.failedPurchase then eventHook.execute(state.eventHooks.failedPurchase, transaction, transactionCurrency, nil, state.config.lang.refundInvalidProduct) end @@ -277,7 +279,9 @@ error(err) end else - refund(transactionCurrency, transaction.from, meta, transaction.value, state.config.lang.refundNoProduct, true) + if state.config.settings.refundInvalidMetaname then + refund(transactionCurrency, transaction.from, meta, transaction.value, state.config.lang.refundNoProduct, true) + end if state.eventHooks and state.eventHooks.failedPurchase then eventHook.execute(state.eventHooks.failedPurchase, transaction, transactionCurrency, nil, state.config.lang.refundNoProduct) end diff --git a/core/schemas.lua b/core/schemas.lua index 49efaa9..8a6c0bd 100644 --- a/core/schemas.lua +++ b/core/schemas.lua @@ -12,7 +12,8 @@ dropDirection = "enum<'forward' | 'up' | 'down' | 'north' | 'south' | 'east' | 'west'>: direction", smallTextKristPayCompatability = "boolean", playSounds = "boolean", - showFooter = "boolean" + showFooter = "boolean", + refundInvalidMetaname = "boolean" }, lang = { footer = "string", diff --git a/radon.lua b/radon.lua index 56b7923..f79accc 100644 --- a/radon.lua +++ b/radon.lua @@ -1,4 +1,4 @@ -local version = "1.3.9" +local version = "1.3.10" local configHelpers = require "util.configHelpers" local schemas = require "core.schemas" local oldPullEvent = os.pullEvent