diff --git a/MWSE/mods/celediel/ASinkingFeeling/config.lua b/MWSE/mods/celediel/ASinkingFeeling/config.lua index 5678e57..f9df291 100644 --- a/MWSE/mods/celediel/ASinkingFeeling/config.lua +++ b/MWSE/mods/celediel/ASinkingFeeling/config.lua @@ -1,5 +1,7 @@ local common = require("celediel.ASinkingFeeling.common") +local currentConfig + local this = {} this.defaultConfig = { @@ -15,21 +17,6 @@ this.defaultConfig = { caseScenarioNecroMode = true } -local currentConfig - -this.resetDefaults = function(config) - local resetConfig = {} - for k, v in pairs(config) do - -- ensure types are consistent, or reset to default - if type(v) == type(this.defaultConfig[k]) then - resetConfig[k] = config[k] - else - resetConfig[k] = this.defaultConfig[k] - end - end - return resetConfig -end - this.getConfig = function() currentConfig = currentConfig or mwse.loadConfig(common.configString, this.defaultConfig) return currentConfig diff --git a/MWSE/mods/celediel/ASinkingFeeling/main.lua b/MWSE/mods/celediel/ASinkingFeeling/main.lua index ac6f9c5..d1e43de 100644 --- a/MWSE/mods/celediel/ASinkingFeeling/main.lua +++ b/MWSE/mods/celediel/ASinkingFeeling/main.lua @@ -1,5 +1,4 @@ -local bigConf = require("celediel.ASinkingFeeling.config") -local config = bigConf.getConfig() +local config = require("celediel.ASinkingFeeling.config").getConfig() local common = require("celediel.ASinkingFeeling.common") -- Helper Functions @@ -158,7 +157,6 @@ end local function onInitialized() event.register("calcSwimSpeed", sinkInWater) - config = bigConf.resetDefaults(config) common.log("Successfully initialized!") end