Michele Caini 6 лет назад
Родитель
Сommit
2fc6fe442d
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/entt/entity/registry.hpp

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

@@ -746,7 +746,7 @@ public:
     template<typename... Component>
     void remove_if_exists(const entity_type entity) {
         ENTT_ASSERT(valid(entity));
-        ([this, entity]() { if(auto &cpool = assure<Component>(); cpool.has(entity)) { cpool.remove(*this, entity); } }(), ...);
+        ([this, entity](auto &&cpool) { if(cpool.has(entity)) { cpool.remove(*this, entity); } }(assure<Component>()), ...);
     }
 
     /**