View Single Post
04/25/23, 12:28 PM   #18
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
I answered that already in one of your past question post:
Code:
EVENT_MANAGER:RegisterForEvent("MyAddon", EVENT_PLAYER_COMBAT_STATE, MyAddon.TeleportPassthroughQueue(displayName))
Wrong function call to MyAddon.TeleportPassthroughQueue(displayName) as this is executed directly as the code is parsed and not as the event fires!
You need to create an anonymous function around it!

Code:
EVENT_MANAGER:RegisterForEvent("MyAddon", EVENT_PLAYER_COMBAT_STATE, function(eventId, param1OfEventPlayerCombatState)
   MyAddon.TeleportPassthroughQueue(displayName)
end)


And btw:Where should the event know the displayName from? You need to pass in the correct displayName as the event itsself does not have any displayname, and if it would not be the account name of someone to jump to.

Last edited by Baertram : 04/25/23 at 12:30 PM.
  Reply With Quote