Parcourir la source

registry: overflow of version and max number of entities (#864)

Corentin Schreiber il y a 3 ans
Parent
commit
2695d48ba7
3 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 1 0
      AUTHORS
  2. 1 0
      TODO
  3. 1 1
      src/entt/entity/registry.hpp

+ 1 - 0
AUTHORS

@@ -11,6 +11,7 @@ ceeac
 ColinH
 corystegel
 Croydon
+cschreib
 cugone
 dbacchet
 dBagrat

+ 1 - 0
TODO

@@ -17,6 +17,7 @@ WIP:
 * custom allocators all over
 * remove storage::patch
 * consider removing ENTT_NOEXCEPT, use ENTT_NOEXCEPT_IF (or noexcept(...)) as appropriate in any case (ie make compressed_pair conditionally noexcept)
+* add test for maximum number of entities reached
 
 WIP:
 * add user data to type_info

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

@@ -302,7 +302,7 @@ class basic_registry {
     }
 
     auto generate_identifier(const std::size_t pos) ENTT_NOEXCEPT {
-        ENTT_ASSERT(pos < entity_traits::to_integral(null), "No entities available");
+        ENTT_ASSERT(pos < entity_traits::to_entity(null), "No entities available");
         return entity_traits::combine(static_cast<typename entity_traits::entity_type>(pos), {});
     }