Hey Baertram, here is what I see. I made some comments on your code with minor fixes showing the problems I see.
Your code with comments:
Warning: Spoiler
Lua Code:
local equipmentMarkerControlName
if pUpdateAllEquipmentTooltips then
--------------------------------------------------------------------------
-- equipmentMarkerControlName is local to this if-end statement & doesn't
-- exist outside of it.
--------------------------------------------------------------------------
-- local equipmentMarkerControlName = markerControl:GetName()
equipmentMarkerControlName = markerControl:GetName()
local replaceEnd = string.len(equipmentMarkerControlName) - locVars.gFCOMaxDigitsForIcons
equipmentMarkerControlName = string.sub(equipmentMarkerControlName, 1, replaceEnd)
d("name: " .. equipmentMarkerControlName)
end
--------------------------------------------------------------------------
--local markedIcons = {}
--------------------------------------------------------------------------
local bagId, slotIndex = MyGetItemDetails(markerControl:GetParent())
--------------------------------------------------------------------------
-- your _ is leaking to global
-- _, markedIcons = FCOIsMarked(GetItemInstanceId(bagId, slotIndex), -1)
--------------------------------------------------------------------------
local _, markedIcons = FCOIsMarked(GetItemInstanceId(bagId, slotIndex), -1)
for iconId, iconIsMarked in pairs(markedIcons) do
if iconIsMarked then
--------------------------------------------------------------------------
-- I'll assume this is defined local in upasted code.
--------------------------------------------------------------------------
markedCounter = markedCounter + 1
--------------------------------------------------------------------------
-- Unfinished if statement. I'm going to guess it should
-- look like this:
--------------------------------------------------------------------------
if markedCounter > 1 then
--------------------------------------------------------------------------
-- I'll assume markerId is defined in upasted code.
--------------------------------------------------------------------------
if iconId ~= markerId and pUpdateAllEquipmentTooltips then
if equipmentMarkerControlName ~= "" then
d("bla: " .. tostring(equipmentMarkerControlName))
else
d("blubb")
end
end
end
end
end