Skip to content

Commit

Permalink
Fix options loading incorrectly sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
Justw8 committed Nov 2, 2024
1 parent ab0dd6d commit 784c41f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ local defaultsDB = {
}

-- Get all options and verify them
local function getOptions()
local db = TeleportMenuDB
function tpm:GetOptions()
local db = TeleportMenuDB or {}
for k, v in pairs(db) do
if defaultsDB[k] == nil then
db[k] = nil
Expand All @@ -48,7 +48,7 @@ function tpm:GetOptionsCategory()
end

function tpm:LoadOptions()
local db = getOptions()
local db = tpm:GetOptions()

do
local optionsKey = "enabled"
Expand Down
5 changes: 2 additions & 3 deletions TeleportMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ function tpm:CreateFlyout(flyoutData)
local flyoutsCreated = 0
local rowNr = 1

local inverse = TeleportMenuDB.reverseMageFlyouts and flyoutData.subtype == "mage"
local inverse = db.reverseMageFlyouts and flyoutData.subtype == "mage"
local start, endLoop, step = 1, spells, 1
if inverse then -- Inverse loop params
start, endLoop, step = spells, 1, -1
Expand Down Expand Up @@ -1048,8 +1048,7 @@ end

local function OnEvent(self, event, addOnName)
if addOnName == "TeleportMenu" then
db = TeleportMenuDB or {}
TeleportMenuDB = db
db = tpm:GetOptions()
db.debug = false
elseif event == "PLAYER_LOGIN" then
checkItemsLoaded(self)
Expand Down

0 comments on commit 784c41f

Please sign in to comment.