Hi,
Now that we (finally) got the fix for WithPresent to align with WithDisabled
Fix invalid queries generated for IJobEntity
with [WithPresent(typeof(T))]
and EnabledRef<T>
and/or in T
in the same job.
we just need for it to work with change filters as well, such that perfectly valid queries such as
foreach (var component in SystemAPI.Query<EnabledRefRO<SomeEnableableComponent>>()
.WithChangeFilter<SomeEnableableComponent>()
.WithPresent<SomeEnableableComponent>())
stop complaining.
1 Like
tertle
December 3, 2024, 6:52pm
2
Reported this and provided a fix at the same time I reported the with present bug but was told the fix for this was too different.
If you want to fix it yourself, it’s a 1 line code change in the generators.
committed 10:18PM - 17 Oct 24 UTC
Just open the generator solution, make this change, hit compile.
(The other code change in this file is the original with present bug fix which you can ignore as its now fixed.)
It’s considered breaking because you’d need to separately include the component in the query instead of just doing a with change filter.
Hi tertle,
Thanks for providing a possible solution.
Just so that I am sure what you suggest in order to fix this, I would:
copy com.unity.entities from the package cache and create a repo from that, or alternatively fork GitHub - needle-mirror/com.unity.entities: The Entities package provides a modern Entity Component System (ECS) implementation with a basic set of systems and components made for Unity. 📦 [Mirrored from UPM, not affiliated with Unity Technologies.]
Make the code change
Replace the reference in the manifest to instead point to github repo?
With regards to the breaking change, while their argument is true, it’s also a bit odd, seeing as it already is the case for WithDisabled, i.e. WithDisabled().WithChangeFilter() will exclude T from the requiredTypes list.
Replacing .Except(_archetype.Present) with .Union(_archetype.Present) would solve it though.
Hi, tertle. If you reported this as a bug via the Bug Reporter, could you let me know what case number was generated for your report?
tertle
December 5, 2024, 6:48pm
5
Hi Jonas,
Sorry no bug report for this as I just directly discussed it with Dani and Cort on discord.
Discord is great for playing games and chilling with friends, or even building a worldwide community. Customize your own space to talk, play, and hang out.