I have been working on a lightweight AddOn to perform some fairly simple modifications to the WorldMapFrame. I am running into issues with the WorldMapFrame tainting when it is opened in combat. I attempted to code my AddOn in such a way that the map won't be touched until combat is dropped, but it is still tainting. Would you guys look over my code and give me some advice?

Lua Code:

-- Local definitions

local hooksecurefunc = hooksecurefunc -- I don't know if this acctually helps, I just want to be cool =[

local mapScale =0.60-- Map scale for easy modification

-- Nevcariel's function for fixing the scale of dropdown menus parented to the WorldMapFrame.

localfunction dropdownScaleFix(self)

ToggleDropDownMenu(nil, nil, self:GetParent())

DropDownList1:SetScale(mapScale)

end

localfunction onShow()

WorldMapFrame:SetScale(mapScale)

end

localfunction sizeDown()

WorldMap_ToggleSizeUp()

end

localfunction sizeUp()

WorldMapFrame:SetAttribute("UIPanelLayout-area", "center")

BlackoutWorld:Hide()

WorldMapFrame:EnableKeyboard(false)

WorldMapFrame:EnableMouse(false)

end

localfunction modifyMap()

if eventHandler then eventHandler:UnregisterEvent("PLAYER_REGEN_ENABLED")end