#Known Bug? The JobEntityGenerator creates broken DefaultQuery for "EnabledRefRW, ref"

1 messages · Page 1 of 1 (latest)

dry cypress
#

The default query generated by JobEntityGenerator is broken, if a job has an attribute WithPresent and one parameter for the enabled state and another as ref for the same component in a particular order

Basically:


struct Comp : IComponentData, IEnableableComponent { int i; }
partial struct TestSystem : ISystem
{
    [WithPresent(typeof(Comp))]
    partial struct JobWorks : IJobEntity
    { void Execute(ref Comp c, EnabledRefRW<Comp> ec) { } }
    
    [WithPresent(typeof(Comp))]
    partial struct JobBroken : IJobEntity
    { void Execute(EnabledRefRW<Comp> ec, ref Comp c) { } }
}```

The JobWorks generates the correct query (only containing WithPresentRW) but the JobBroken will generate the following (wrong) default query:

        DefaultQuery = 
            entityQueryBuilder
                .WithPresentRW<global::Comp>()
                .WithAllRW<global::Comp>()
                .Build(ref state);

Is this a known issue?
dry cypress