I just ran that code in-game and it worked as expected. It's possible you're running it too early, and the Blizzard UI or another addon is resetting it by the time the login process is finished. Try waiting for PLAYER_LOGIN, and if that doesn't work, just run it again every time ADDON_LOADED fires.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
|