Skip to content

Commit

Permalink
Fix: Wormhole teleport error when checking usableWormholes length (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshjau authored Feb 27, 2025
1 parent c462a0b commit fb94ea0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Data/Wormholes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function tpm:UpdateAvailableWormholes()
tpm.AvailableWormholes = availableWormholes
tpm.AvailableWormholes.GetUsable = function()
if #tpm.AvailableWormholes == 0 then
return 0
return {}
end

local usableWormholes = {}
Expand Down
12 changes: 5 additions & 7 deletions TeleportMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -705,13 +705,11 @@ function tpm:CreateWormholeFlyout(flyoutData)
button:SetPoint("LEFT", TeleportMeButtonsFrame, "TOPRIGHT", 0, yOffset)

local flyoutsCreated = 0
for _, wormholeId in ipairs(tpm.AvailableWormholes) do
if C_ToyBox.IsToyUsable(wormholeId) then
flyoutsCreated = flyoutsCreated + 1
local flyOutButton = CreateSecureButton(flyOutFrame, "toy", nil, wormholeId)
local xOffset = globalWidth * flyoutsCreated
flyOutButton:SetPoint("TOPLEFT", flyOutFrame, "TOPLEFT", xOffset, 0)
end
for _, wormholeId in ipairs(usableWormholes) do
flyoutsCreated = flyoutsCreated + 1
local flyOutButton = CreateSecureButton(flyOutFrame, "toy", nil, wormholeId)
local xOffset = globalWidth * flyoutsCreated
flyOutButton:SetPoint("TOPLEFT", flyOutFrame, "TOPLEFT", xOffset, 0)
end
flyOutFrame:SetSize(globalWidth * (flyoutsCreated + 1), globalHeight)

Expand Down

0 comments on commit fb94ea0

Please sign in to comment.