Michele Caini пре 6 година
родитељ
комит
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.
      */
     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.
      */
     bool contains(const entity_type entt) const {
-        return find(entt) != end();
+        return pool->has(entt);
     }
 
     /**