View Single Post
07-12-15, 06:54 AM   #2
Jarod24
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2012
Posts: 66
If i understand correctly the scenario you are describing, then the problem is that your code is running -before- everything in the game is finished loading properly.

-Do not run the code until after PLAYER_ENTERING_WORLD has fired.
-Possibly run it 1 second after the event has triggered. Take a look at the C_Timer.After() function to make a callback function to yourself.

Does the code have to be executed the instant the user is logging in/reloading?
Maybe use some other event or function that you can hook into (player moved, character tab opened).


You mention UNIT_INVENTORY_CHANGED firing 112 times; You could always change it so that your code only runs once and ignores the other 111 times it's fired:
-unregister from the event after the first time its triggered
-use a boolean to stop the code executing more than once (booFirstTime = false/true)
__________________
Author of IfThen, Links in Chat

Last edited by Jarod24 : 07-12-15 at 07:06 AM.
  Reply With Quote