snapshot: use component_traits instead of is_empty_v

This commit is contained in:
Michele Caini
2023-05-26 08:49:15 +02:00
parent e4f51f2b7f
commit fc8eebf367

View File

@@ -250,7 +250,7 @@ public:
archive(length);
if constexpr(std::is_empty_v<Component>) {
if constexpr(Registry::template storage_for_type<Component>::traits_type::page_size == 0u) {
while(length--) {
archive(entt);
const auto entity = storage.contains(entt) ? entt : storage.emplace(entt);
@@ -426,7 +426,7 @@ class basic_continuous_loader {
archive(length);
if constexpr(std::is_empty_v<Component>) {
if constexpr(Registry::template storage_for_type<Component>::traits_type::page_size == 0u) {
while(length--) {
archive(entt);
restore(entt);