Closed L3nn0x closed 7 years ago
After investigation, it turned out it was an issue from another part of the code (the entity was deleted but still accessed afterwards).
👍
Obviously I tried to solve this error for a week and I find the solution 10 minutes after posting the issue...
Always the way :) It's those rubber ducks!
Indeed indeed, I definitely need one on my desk ;)
Hello,
I am using the compile time branch, latest commit. I have a multiplayer game where the players are represented using entities and components. Players can connect and disconnect when they want. Every time a player connects, an entity is created and some components are assigned to it. when the player disconnects, the entity is destroyed.
When a player connects, disconnects and connects again, the entity is created, destroyed and created again. When the entity is re-created, the entity has the same id, and one of the component fails the valid() assertion. It looks like the entity is considered invalid although it has been created and can be assigned components.
Do you have any idea why?
Thank you.
Edit: the error:
entityx/entityx/entityx.hh:390: entityx::EntityX<StorageType, Features, Cs>::enable_if_component<C, C*> entityx::EntityX<StorageType, Features, Cs>::Entity::component(): Assertion 'valid()' failed.