View Single Post
01-06-24, 06:06 AM   #1
Ssesmar2
A Murloc Raider
 
Ssesmar2's Avatar
Join Date: Jan 2024
Posts: 6
tried to call the protected function 'OnOpen()'

I use this code here so that icons created by my addon can be clicked on different maps (azeroth, continent, zone or instance map).

Lua Code:
  1. function pluginHandler:OnClick(button, pressed, uiMapId, coord)
  2.     if (not pressed) then return end
  3.     if (button == "LeftButton") then
  4.       local mnID = nodes[uiMapId][coord].mnID
  5.       if mnID then
  6.          WorldMapFrame:SetMapID(mnID)
  7.       end
  8.     end
  9. end

This works perfectly, only after you press a symbol of my addon on a map and then call up the map of a dungeon twice and press each time on a boss on the map, I get this error after the second time

2x [ADDON_ACTION_FORBIDDEN] AddOn 'test' tried to call the protected function 'OnOpen()'.
[string "@!BugGrabber/BugGrabber.lua"]:481: in function <!BugGrabber/BugGrabber.lua:481>
[string "=[C]"]: in function `OnOpen'
[string "@Blizzard_EncounterJournal/Blizzard_EncounterJournal.lua"]:586: in function <...zzard_EncounterJournal/Blizzard_EncounterJournal.lua:575>
[string "=[C]"]: in function `Show'
[string "@FrameXML/UIParent.lua"]:2938: in function `SetUIPanel'
[string "@FrameXML/UIParent.lua"]:2838: in function `ShowUIPanel'
[string "@FrameXML/UIParent.lua"]:2646: in function <FrameXML/UIParent.lua:2642>
[string "=[C]"]: in function `SetAttribute'
[string "@FrameXML/UIParent.lua"]:3248: in function `ShowUIPanel'
[string "@Blizzard_EncounterJournal/Blizzard_EncounterJournal.lua"]:2390: in function `EncounterJournal_OpenJournal'
[string "@Blizzard_SharedMapDataProviders/EncounterJournalDataProvider.lua"]:145: in function `OnMouseClickAction'
[string "@Blizzard_MapCanvas/MapCanvas_DataProviderBase.lua"]:156: in function `OnClick'
[string "@Blizzard_MapCanvas/Blizzard_MapCanvas.lua"]:154: in function <...aceBlizzard_MapCanvas/Blizzard_MapCanvas.lua:151>
  Reply With Quote