EcsRx / ecsrx

A reactive take on the ECS pattern for .net game developers
MIT License
520 stars 36 forks source link

Iterating ObservableGroup by index does not work properly #7

Closed JayPavlina closed 5 years ago

JayPavlina commented 5 years ago

When doing:

for (int i = 0; i < observableGroup.Count; i++) { var entity = observableGroup[i]; }

The returned entity will sometimes be null.

grofit commented 5 years ago

Thanks for raising this, the issue is down to the re-use of existing indexes inside the list which wasnt accounted for, luckily this is just in the prototype branch and not in the master releases. I will look into the avenues to trying to keep performance high but also removing the output of nulls.

grofit commented 5 years ago

This should be fixed in the Parallel branch, I will mark this as fixed but feel free to re-raise if its causing issues.