Originally Posted by Savitar
Or is there a way to wipe a saved structure in memory so that on a /reloadui the data in a SavedVar isn't saved over with the in memory data but refreshed from the SavedVar data?
|
You can simply delete the saved variables table and it won't be saved.
Lua Code:
-- given that in manifest you have ## SavedVariables: mySavedVars
-- delete the table (not the file) so it won't rewrite the file on /reloadui
_G["mySavedVars"] = nil
Or if you want to be able to go back to the saved state without reload, you can backup the state on load and restore later:
Lua Code:
-- save a copy of saved vars after load
backupSavedVars = ZO_DeepTableCopy(mySavedVars)
-- then you can restore the saved state
ZO_ClearTable(mySavedVars)
ZO_DeepTableCopy(backupSavedVars, mySavedVars)