EcsRx / ecsrx

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

EntityDatabaseManagerExtensions.GetEntity() not behaving as expected #28

Closed Fijo closed 2 years ago

Fijo commented 2 years ago

Today I noticed that the EntityDatabaseManagerExtensions.GetEntity(entityDatabase, id) does not work as it is suposed to when using multiple EntityCollections and the entity with the specified id isn't found in the first collection. An exception is thrown here but the code body in that extension method suggests the writer was assuming it'd collection.GetEntity(id) would return null if there's no entity with the id present in that entity collection.

grofit commented 2 years ago

I will take a look into it after the bank holiday as I cant do much with kids around, but its probably a left over from when I did the re-write of how components/entities were tracked, so it sounds like a legitimate bug.

As always thanks for taking the time to report it

grofit commented 2 years ago

This should be fixed within the latest changes on master, however it hasnt been pushed out as a release yet, given this and the next couple of PRs may change the API somewhat I will wait until that is done before I flag it as complete.

grofit commented 2 years ago

Im flagging this as closed as I am sure it was done in the previous release, feel free to re-raise if its not.