Originally Posted by haggen
Ayantir correct if I'm wrong but I think that if you initialized a SavedVars with same name but different version then your previous data was wiped, as in:
Lua Code:
ZO_SavedVars:New("SOMETHING", 1, nil, {x = 1}) ZO_SavedVars:New("SOMETHING", 2, nil, {}) --> version 1 is no more SOMETHING.Default[GetDisplayName()]["x"] == nil --> true
|
Ayantir is talking about doing it before using the helper class.
Lua Code:
local olddata = SOMETHING.Default[GetDisplayName()]
-- Check for old data and migrate
ZO_SavedVars:New("SOMETHING", 2, nil, {}) --> version 1 is no more
-- save migrated data, if exists
Which means, you have to know how the helper works.
The problem is within the helper, which saves the given version as the current version. No matter, if there is a higher version.
As soon as you query for version 1, version 2 will become version 1.