diff --git a/src/entt/entity/snapshot.hpp b/src/entt/entity/snapshot.hpp index 70b412def..db0f8b804 100644 --- a/src/entt/entity/snapshot.hpp +++ b/src/entt/entity/snapshot.hpp @@ -86,13 +86,14 @@ public: */ template const basic_snapshot &entities(Archive &archive) const { - const auto sz = static_cast(reg->size()); - const auto released = static_cast(reg->released()); + const auto &storage = reg->template storage(); + const auto sz = static_cast(storage.size()); + const auto released = static_cast(sz - storage.in_use()); archive(sz); archive(released); - for(auto first = reg->data(), last = first + sz; first != last; ++first) { + for(auto first = storage.data(), last = first + sz; first != last; ++first) { archive(*first); }