Преглед на файлове

storage: reset next on clear

Michele Caini преди 2 години
родител
ревизия
f2a8c0ffe6
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      src/entt/entity/storage.hpp

+ 6 - 0
src/entt/entity/storage.hpp

@@ -957,6 +957,12 @@ class basic_storage<Entity, Entity, Allocator>
     }
     }
 
 
 protected:
 protected:
+    /*! @brief Erases all entities of a storage. */
+    void pop_all() override {
+        base_type::pop_all();
+        next = {};
+    }
+
     /**
     /**
      * @brief Assigns an entity to a storage.
      * @brief Assigns an entity to a storage.
      * @param hint A valid identifier.
      * @param hint A valid identifier.