Skip to content

Commit

Permalink
Use a different config_version
Browse files Browse the repository at this point in the history
I'm kind of an idiot sometimes.
  • Loading branch information
nebularg committed May 12, 2024
1 parent 2a97af3 commit 5396c97
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1210,18 +1210,18 @@ local function check_config_version(sv)
global = {}
sv.global = global
end
if not global.config_version then
if not global.classic_config_version then
-- Existing config without config_version, so set it to 1
global.config_version = 1
global.classic_config_version = 1
end

while (global.config_version < CURRENT_CONFIG_VERSION) do
if upgrade_functions[global.config_version] then
if not upgrade_functions[global.config_version](sv) then
error(format(L["Problem upgrading PitBull4 config_version %d to %d. Please file a ticket and attach your WTF/Account/$ACCOUNT/SavedVariables/PitBull4.lua file!"],global.config_version,global.config_version + 1))
while (global.classic_config_version < CURRENT_CONFIG_VERSION) do
if upgrade_functions[global.classic_config_version] then
if not upgrade_functions[global.classic_config_version](sv) then
error(format(L["Problem upgrading PitBull4 classic_config_version %d to %d. Please file a ticket and attach your WTF/Account/$ACCOUNT/SavedVariables/PitBull4.lua file!"],global.classic_config_version,global.classic_config_version + 1))
end
end
global.config_version = global.config_version + 1
global.classic_config_version = global.classic_config_version + 1
end
end

Expand All @@ -1232,7 +1232,7 @@ function PitBull4:OnInitialize()
self.db = db

if fresh_config then
db.global.config_version = CURRENT_CONFIG_VERSION
db.global.classic_config_version = CURRENT_CONFIG_VERSION
end

db.RegisterCallback(self, "OnProfileChanged")
Expand Down

0 comments on commit 5396c97

Please sign in to comment.