Browse Source

Epoch lua error fix

pull/25/head
Szyler 7 months ago
parent
commit
97c5fabc8a
  1. 10
      TradeSkillMaster/Core/Groups.lua
  2. 4
      TradeSkillMaster/Core/Options.lua
  3. 4
      TradeSkillMaster/TradeSkillMaster.lua

10
TradeSkillMaster/Core/Groups.lua

@ -1315,6 +1315,7 @@ function TSM:ImportGroup(importStr, groupPath)
local items = {}
local currentSubPath = ""
local itemID, randomEnchant = nil, nil
for _, str in ipairs(TSMAPI:SafeStrSplit(importStr, ",")) do
str = str:trim()
local noSpaceStr = gsub(str, " ", "") -- forums like to add spaces
@ -1327,7 +1328,7 @@ function TSM:ImportGroup(importStr, groupPath)
elseif strfind(noSpaceStr, "p") then
itemString = gsub(noSpaceStr, "p", "battlepet")
elseif strfind(noSpaceStr, ":") then
local itemID, randomEnchant = (":"):split(noSpaceStr)
itemID, randomEnchant = (":"):split(noSpaceStr)
if not tonumber(itemID) or not tonumber(randomEnchant) then return end
itemString = "item:"..tonumber(itemID)..":0:0:0:0:0:"..tonumber(randomEnchant)
end
@ -1336,8 +1337,13 @@ function TSM:ImportGroup(importStr, groupPath)
currentSubPath = subPath
elseif itemString then
items[itemString] = currentSubPath
local item = Item:CreateFromID(tonumber(noSpaceStr))
itemID = itemID or noSpaceStr
if Item then
local item = Item:CreateFromID(tonumber(itemID))
item:Query()
else
TSMAPI:GetSafeItemInfo(tonumber(itemID))
end
else
return
end

4
TradeSkillMaster/Core/Options.lua

@ -943,8 +943,12 @@ function private:LoadProfilesPage(container)
-- check if item is cached
local _,_,itemID = itemString:find("item:(%d+)")
if itemID then
if Item then
local item = Item:CreateFromID(itemID)
item:Query()
else
TSMAPI:GetSafeItemInfo(tonumber(itemID))
end
end
end

4
TradeSkillMaster/TradeSkillMaster.lua

@ -239,8 +239,12 @@ function TSM:OnInitialize()
-- check if item is cached
local _,_,itemID = itemString:find("item:(%d+)")
if itemID then
if Item then
local item = Item:CreateFromID(itemID)
item:Query()
else
TSMAPI:GetSafeItemInfo(tonumber(itemID))
end
end
if strfind(itemString, " ") then
local newItemString = gsub(itemString, " ", "")

Loading…
Cancel
Save