-
-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System with an optional component in its query does not fire when that component is disabled using ecs_enable_component #314
Comments
The reason this happens is because disabled components are still stored in the same array as enabled components. Each array is made available once to the system, and so when you have a query with an optional component, you will get a pointer to that array from I agree that this is not ideal. To fix this, queries that iterate an optional column with disabled values should iterate the column twice: once for entities with enabled values and once for entities with disabled values. In the latter case I could make I'll start working on a design for this. |
FYI it's not pressing for me, just saw the change & thought it might be better for a case I have. I'd say in the short term maybe just a note in the docs about it would help. |
Describe the bug
[edit] I was wrong in thinking the example was working - I was checking the wrong thing.
I'm not sure if this is intended behavior or not. If I modify example 50 to add an optional component to the system like this:
The result is:
I would expect the 2nd run to include
e2: no position
.Is this the expected behavior when disabling components? I was assuming they'd act the same as
ecs_remove()
in this case.The text was updated successfully, but these errors were encountered: