Closed kevinresol closed 4 years ago
My bug still happens with this "fix"
Hmm. I've experienced the same issue, although with more complex code.
The solution looks very odd though. Is there a public repo with that has the issue you're experiencing?
please see #51
Awesome, thanks ;)
I am not sure about this actually.
I spent 2 full days trying to track down a bug in my ecs where my entity list is not refreshing upon a dependency change, and I came along this line of "uncertain" code. I am desperate for any solution so I tried to change the line and apparently it fixed my problem. (Because I am also unable to reduce the bug from my pretty complex dependency tree)
Here is my code (suggested by @back2dos in gitter) for reference:
The issue was that at some very special scenario the computation of
entity.fulfills(q)
gets re-evaluated when the dependency changed but the comparator doesn't consider that as a change (confirmed with a custom comparator) because the old/new value are the same. I can't understand why that happens because I can't seem to capture where the flip of the boolean happened.