#Bug: duplicate component exception when using an enableable buffer

1 messages · Page 1 of 1 (latest)

vocal finch
#

I recently converted an enableable component to be an enableable buffer, and now this foreach creates an exception during world instantiation.

foreach (var (parentBuffer, parentEnabledRef, entity) in SystemAPI
.Query<DynamicBuffer<ParentBuffer>, EnabledRefRO<ParentBuffer>>()
.WithAll<PredictedGhost, Simulate, IsEnabled>()
.WithPresent<ParentBuffer>()
.WithEntityAccess())

Removing the WithPresent<ParentBuffer>() removes the exception, but now the foreach doesn't affect entities with the buffer disabled.

ECS 1.4.0-exp.2.

@austere trellis?

clear palm
#

you probably want to paste the exception

vocal finch
#

EntityQueryDescValidationException: EntityQuery contains a filter with duplicate component type name ParentBuffer. Queries can only contain a single component of a given type in a filter.
Unity.Entities.EntityQueryBuilder.ThrowDuplicateComponentTypeError (Unity.Entities.TypeIndex curId) (at Library/PackageCache/com.unity.entities@6f0c8b1c3dc0/Unity.Entities/Iterators/EntityQueryBuilder.cs:1959)
Unity.Entities.EntityQueryBuilder.Validate (Unity.Collections.LowLevel.Unsafe.UnsafeList1[Unity.Entities.ComponentType]& allTypes, Unity.Collections.LowLevel.Unsafe.UnsafeList1[Unity.Entities.ComponentType]& anyTypes, Unity.Collections.LowLevel.Unsafe.UnsafeList1[Unity.Entities.ComponentType]& noneTypes, Unity.Collections.LowLevel.Unsafe.UnsafeList1[Unity.Entities.ComponentType]& disabledTypes, Unity.Collections.LowLevel.Unsafe.UnsafeList1[Unity.Entities.ComponentType]& absentTypes, Unity.Collections.LowLevel.Unsafe.UnsafeList1[Unity.Entities.ComponentType]& presentTypes) (at Library/PackageCache/com.unity.entities@6f0c8b1c3dc0/Unity.Entities/Iterators/EntityQueryBuilder.cs:1993)
Unity.Entities.EntityQueryManager.CreateArchetypeQueries (Unity.Collections.LowLevel.Unsafe.UnsafeScratchAllocator& unsafeScratchAllocator, Unity.Entities.EntityQueryBuilder& queryBuilder) (at Library/PackageCache/com.unity.entities@6f0c8b1c3dc0/Unity.Entities/Iterators/EntityQueryManager.cs:339)
Unity.Entities.EntityQueryManager.CreateEntityQuery (Unity.Entities.EntityDataAccess* access, Unity.Entities.EntityQueryBuilder query) (at Library/PackageCache/com.unity.entities@6f0c8b1c3dc0/Unity.Entities/Iterators/EntityQueryManager.cs:655)
Unity.Entities.EntityManager.CreateEntityQueryUnowned (Unity.Entities.EntityQueryBuilder& queriesDesc) (at Library/PackageCache/com.unity.entities@6f0c8b1c3dc0/Unity.Entities/EntityManager.cs:4536)
Unity.Entities.SystemState.GetEntityQueryInternal (Unity.Entities.EntityQueryBuilder desc) (at Library/PackageCache/com.unity.entities@6f0c8b1c3dc0/Unity.Entities/SystemState.cs:795)
Unity.Entities.SystemState.GetEntityQuery (Unity.Entities.EntityQueryBuilder& builder) (at Library/PackageCache/com.unity.entities@6f0c8b1c3dc0/Unity.Entities/SystemState.cs:875)
Unity.Entities.EntityQueryBuilder.Build (Unity.Entities.SystemState& systemState) (at Library/PackageCache/com.unity.entities@6f0c8b1c3dc0/Unity.Entities/Iterators/EntityQueryBuilder.cs:1904)