Michele Caini 8 년 전
부모
커밋
8b89c69d5f
1개의 변경된 파일12개의 추가작업 그리고 1개의 파일을 삭제
  1. 12 1
      src/entt/entity/registry.hpp

+ 12 - 1
src/entt/entity/registry.hpp

@@ -655,13 +655,24 @@ public:
      */
      */
     void reset() {
     void reset() {
         available.clear();
         available.clear();
-        pools.clear();
 
 
         for(auto &&entity: entities) {
         for(auto &&entity: entities) {
             const auto version = 1 + ((entity >> traits_type::entity_shift) & traits_type::version_mask);
             const auto version = 1 + ((entity >> traits_type::entity_shift) & traits_type::version_mask);
             entity = (entity & traits_type::entity_mask) | (version << traits_type::entity_shift);
             entity = (entity & traits_type::entity_mask) | (version << traits_type::entity_shift);
             available.push_back(entity);
             available.push_back(entity);
         }
         }
+
+        for(auto &&handler: handlers) {
+            if(handler) {
+                handler->reset();
+            }
+        }
+
+        for(auto &&pool: pools) {
+            if(pool) {
+                pool->reset();
+            }
+        }
     }
     }
 
 
     /**
     /**