Can Anyone Explain This Mystery?
I'm stumped... I've worked around it but I'd like to know why it happens. Calling C_PetJournal.GetNumPets() in the handler for the PLAYER_LOGIN or PLAYER_ENTERING_WORLD returns 0... but sticking the call at the beginning of the addon works just fine.
Code:
local numPets = C_PetJournal.GetNumPets() Subsequent calls after login are back to normal. I'm confused why it wouldn't work in the PLAYER_LOGIN handler, despite the API being available before. I'll give 1 or 2 helpful geniuses here any of the new Raiding With Leashes Pets if you can solve this mystery!! :banana: |
Need to see more code. I have a couple of assumptions, but without code I can't know for sure.
Is the AddomFrame handler that you defined being called from the XML template? Or somewhere else in Lua? |
You'd better try the PET_JOURNAL_LIST_UPDATE event to start using the pet data
|
most api functions that provide data about the character or account will return data from the previously logged in character if called before PLAYER_LOGIN.
If you close the game you'll probably find it returns 0 both times. |
Quote:
:D |
All times are GMT -6. The time now is 01:37 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI