View Single Post
04-11-21, 06:22 AM   #8
sezz
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 158
Originally Posted by LudiusMaximus View Post
If nobody has an answer to this strange behaviour of AceEvent-3.0,
maybe someone can tell me how to let my code check itself if an event exists?
Thanks!
did you try if it works without using acevent which itself uses callbackhandler and that's propably why it doesn's work as you expect it?

Lua Code:
  1. local f = CreateFrame("Frame");
  2.  
  3. local EventExists = function(event)
  4.     if (pcall(function() f:RegisterEvent(event); end)) then
  5.         f:UnregisterEvent(event);
  6.         return true;
  7.     end
  8. end
  9.  
  10. print(EventExists("MEH"));
  11. print(EventExists("PLAYER_LOGIN"));
  Reply With Quote