fenomas / noa

Experimental voxel game engine.
MIT License
615 stars 88 forks source link

Note regarding ECS component removal #161

Closed fenomas closed 3 years ago

fenomas commented 3 years ago

FYI to users: the most recent #develop update changes the ECS to a newer version, that handles component removals slightly differently.

Previously, when you removed a component from an entity (or deleted an entity), the actual removal was deferred so as not to mess up entity loops. So if you queried the same component state immediately afterwards you'd get the state of the removed component.

The new version handles removals immediately, with some internal magic to keep the removed state from affecting any currently-running loops. This means that various edge cases, where you try to access an entity's state immediately after that entity was deleted, the relevant APIs will now return null where previously they would have returned the (now outdated) state object.

Please comment here if you have any intractable issues with this, thanks!

fenomas commented 3 years ago

Hopefully everyone's okay with this ;)