View Single Post
01/09/23, 06:00 AM   #1
cabwav
Join Date: Aug 2020
Posts: 7
Saving Companiondata on user Logout

Hi Guys

I am writing an addon that saves all kinds of character data to SavedVariables on user logout. The data is saved to a SavedVariables block in a function that is called at the EVENT_PLAYER_DEACTIVATED event. All character data is saved as expected, but at the time of the event, the active Companion is already de-activated, so I cannot save Companion data like e.g. rapport. When I /reloadui the companion data is saved as expected, so apparently the Companion is still active at this point, but not at the event as mentioned above.

Is there a way to detect that a normal logout is about to happen, and where the currently selected Companion is still active?

I tried the EVENT_ACTIVE_COMPANION_STATE_CHANGED but this has the same result: no active Companion on user Logout

Many thanks in advance, Cabwav
  Reply With Quote