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

+ 3 - 2
src/entt/entity/view.hpp

@@ -359,7 +359,8 @@ public:
      * @return True if the view contains the given entity, false otherwise.
      * @return True if the view contains the given entity, false otherwise.
      */
      */
     bool contains(const entity_type entt) const {
     bool contains(const entity_type entt) const {
-        return find(entt) != end();
+        return (std::get<pool_type<Component> *>(pools)->has(entt) && ...)
+                && (!std::get<pool_type<Exclude> *>(pools)->has(entt) && ...);
     }
     }
 
 
     /**
     /**
@@ -688,7 +689,7 @@ public:
      * @return True if the view contains the given entity, false otherwise.
      * @return True if the view contains the given entity, false otherwise.
      */
      */
     bool contains(const entity_type entt) const {
     bool contains(const entity_type entt) const {
-        return find(entt) != end();
+        return pool->has(entt);
     }
     }
 
 
     /**
     /**