In the past I enlisted the help of this forum to make a custom addon that would hide flight path icons (and a few others I've added) from the world map. An awesome member named Phanx wrote it up for me free of charge, and I've used it ever since! I recently returned from a WoW hiatus and it seems to have broken somehow. I'm no addon coder by any means; could you help me update it again so it'll keep functioning?

I have an addon that does the main task of hiding the icons, and I also have a macro that scans the world map I'm in for landmark POI numbers. The problem I'm having now is that the icons aren't being hidden, and the macro returns a list of nil.

This is what the addon looks like currently:

Code:

hooksecurefunc("WorldMapFrame_Update", function()
for i = 1, GetNumMapLandmarks() do
local _, name, _, textureIndex = GetMapLandmarkInfo(i)
if textureIndex == 0 or textureIndex == 5 or textureIndex == 6 or textureIndex == 46 or textureIndex == 48 or textureIndex == 178 or textureIndex == 179 or textureIndex == 180 or textureIndex == 188 or textureIndex == 194
then
local poi = _G["WorldMapFramePOI"..i]
if poi then
-- The "if poi then" check is probably not needed, but better safe than sorry!
poi:Hide()
end
end
end
end)