You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am saving my game state into structure local saveData = { game = game:serializeTab(), view = view:serializeTab(), actors = {} }
then actors table is filled in a loop using table.insert()
It seems then actors table, being pure integer based, continous array should be iterable using both pairs and ipairs.
However after I use bitser.loads() I encounter non deterministic errors when iterating over this unserialized table using pairs(). For some reason values are sometimes duplicated with same data and different table addresses. The solution here is to iterate over actors with ipairs. This way no duplicated values are found.
Frankly I don't know if bitser is to blame. I have added duplicate checks right after unserialization and even after duplicates are found to check table integrity. Both to no avail. So my only suspicion is that the deserialized table is somehow faulty.
The text was updated successfully, but these errors were encountered:
I am saving my game state into structure
local saveData = { game = game:serializeTab(), view = view:serializeTab(), actors = {} }
then actors table is filled in a loop using table.insert()
It seems then actors table, being pure integer based, continous array should be iterable using both
pairs
andipairs
.However after I use
bitser.loads()
I encounter non deterministic errors when iterating over this unserialized table usingpairs()
. For some reason values are sometimes duplicated with same data and different table addresses. The solution here is to iterate over actors withipairs
. This way no duplicated values are found.Frankly I don't know if bitser is to blame. I have added duplicate checks right after unserialization and even after duplicates are found to check table integrity. Both to no avail. So my only suspicion is that the deserialized table is somehow faulty.
The text was updated successfully, but these errors were encountered: