View Single Post
05-20-19, 05:24 AM   #5
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
Originally Posted by galvin View Post
So the error is happening cause of something blizzard is doing then?
The manner in which you pass the function you use to process the events affects what arguments you get passed during runtime.

widget:SetScript("OnEvent, function(self, event, ...) end) the self would (in most cases) be same as widget, followed by the event that called the function, and a list of potential arguments.

In your code you mislabel it like widget:SetScript("OnEvent, function(event, ...) end) thus you now use event thinking it's the event name, but it's actually the widget reference, and the arguments following when unpacked like local arg1, arg2 = ... now actually set arg1 to be the event, then arg2 would be the first argument of that event.
__________________
Profile: Curse | Wowhead
  Reply With Quote