View Single Post
03/26/20, 03:18 PM   #9
Scootworks
 
Scootworks's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2014
Posts: 312
Originally Posted by Phinix View Post
@sirinsidiator - Thanks for taking a look. It is difficult to troubleshoot because there is a lot of code here. But I suspect if you manually plug a color value in place of that function so it cannot possibly be nil the return will still be nil, based on other experiece I am having with this (similar to what Baertram describes).

For example, correcting the above I immediately get an error referencing line 150 of MasterRecipeList\bin\SetupPreFrames.lua which looks like:

Code:
for k = 1, 1895 do ESOMRL.FurnitureRecipes[pLI(ESOMRL.FurnitureTable[k].link)] = {position = k} end
pLI is a local alias defined at the top of the same file for LibPhinixFunctions.GetItemIdFromLink, which looks like this:

Code:
function lib.GetItemIdFromLink(itemLink)-- Parse an item link for the itemId.
    local itemId = select(4, ZO_LinkHandler_ParseLink(itemLink))
    -- itemLink: Either generated from the UI/Events/Functions or manually as a link string in quotes

    if itemLink == nil then
        if lib.ASV.enableDebug then
            d("LibPhinixFunctions: No link passed to GetItemIdFromLink function.")
        end
        return
    end

    if itemId then
        return tonumber(itemId)
    else
        if lib.ASV.enableDebug then d("LibPhinixFunctions: No valid link passed to GetItemIdFromLink function.") end
    end
end
I also tried just parsing the link string with gsub, but the problem is that the function is immediately returning nil without actually processing, until the addon depending on it is fully loaded.

Again these functions were all working before the recent patches since it was uploaded, and working around one error immediately results in a new one, basically for ANY call to this library.

I will try what Baertram suggests but this is also difficult as some of the calls are loaded in files of this addon that load from the manifest before the one which actually contains the event_add_on_loaded callback.

Could that be the problem?
btw there is a function to get itemId:

Lua Code:
  1. GetItemLinkItemId(string itemLink)
  2. Returns: number itemId
  Reply With Quote