diff options
author | max-001 <maxsmits21@kpnmail.nl> | 2024-11-05 14:26:41 +0100 |
---|---|---|
committer | max-001 <maxsmits21@kpnmail.nl> | 2024-11-05 14:26:41 +0100 |
commit | 3d6fbf38dba40c97d2a06cfe2cf344190d05cfe4 (patch) | |
tree | 6957a65e4e34793b64e3f9d74ac49668e04ea7f2 | |
parent | dd24187ba7bcd534a54b723735168f45e9612051 (diff) |
Implemented -1 case
-rw-r--r-- | src/crepe/ComponentManager.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/crepe/ComponentManager.hpp b/src/crepe/ComponentManager.hpp index 828ca8e..66e027f 100644 --- a/src/crepe/ComponentManager.hpp +++ b/src/crepe/ComponentManager.hpp @@ -33,7 +33,8 @@ T & ComponentManager::add_component(uint32_t id, Args &&... args) { T * instance = new T(id, forward<Args>(args)...); // Check if the vector size is not greater than get_instances_max - if (components[type][id].size() >= instance->get_instances_max()) { + if (instance->get_instances_max() != -1 + && components[type][id].size() >= instance->get_instances_max()) { throw std::runtime_error( "Exceeded maximum number of instances for this component type"); } |