Comments (8)
Well, let me know if I can help hands-on with the code then. I'm more than willing in case. 🙂👍
from entt.
maybe that should assert already?
I think the upstream version already contains these asserts for the next release. Someone popped up with the exact same request less than a month ago. 🙂
from entt.
I cannot say what's happening without a repro. However, do you have listeners on components? As an example, a listener that gets triggered when a component is erased.
from entt.
Thanks for the idea, but no :/
We use entt::dispatcher for some event stuff, but nothing related to entity deletion, as far as I can tell.
The code can't be shared unfortunately...
After further analysis:
version_type destroy(const entity_type entt, const version_type version) {
for(size_type pos = pools.size(); pos; --pos) {
pools.begin()[pos - 1u].second->remove(entt);
}
return release(entt, version);
}
calls the remove func:
bool remove(const entity_type entt) {
return contains(entt) && (erase(entt), true);
}
and the contains
returns false here, which is opaque, as this is the first call to destroy for this entity.
The returned entity from the registry is saved to a local variable inside a member function. This variable is passed in by value capture to a lambda and the lambda does the destroy call.
Maybe there is something wrong with the saving/passing of the entity? But not sure what could be wrong there...
(also, it always happens with entt::to_integral == 4294967296)
from entt.
from entt.
good enough XD
It is not. You're probably hiding an UB with this guard.
from entt.
Ofcs not, but as you pointed out, without the code, no one will be able to help, so this issue does not make much sense here.
from entt.
Thank you very much for the offer, much appreciated!
But we actually found the issue this evening (still not sure why it caused the assert, though; but after the fix we aren't facing the crash anymore).
It's actually quite embarrassing (even more, because it was me refactoring this, but sometimes stuff just goes wrong XD). In one class we had an uninitialized entt::entity member variable. At some event trigger, the class was assigning a component to that entity over emplace_or_replace, which works just fine (maybe that should assert already?).
And somehow this leads to the assert mentioned at the top, no clue why, but the error was ofc adding the component to an uninitialized entt::entity, which maybe messes up some internal state...
from entt.
Related Issues (20)
- Handling large tilemap HOT 7
- Acecss components of an entity, without giving full registry access HOT 14
- bazel version and compatibility number out of sync HOT 5
- storage<entt::entity>("id"_hs) should be asserted against HOT 2
- Get a view of components with a certain trait HOT 2
- Groups not functioning without sigh_mixin HOT 1
- Reliability across a network?
- Can't emplace component derived from std::vector HOT 4
- Iterating over all entities HOT 2
- Documentation references the deprecated registry-based `entt::to_entity` API HOT 2
- Is basic_collector::update supposed to support a list of component types? HOT 2
- entt.wiki has filenames with : in them, which probably causes problems with Git on Windows HOT 4
- ENTT WIKI: The Game Engine Series's Big Brother HOT 1
- registry.valid() causing an exception instead of returning false HOT 5
- Include assertion message in underlying `assert` call HOT 2
- Proposal: Automatic signal registration for components HOT 2
- meta: data function fails if setter is noexcept HOT 4
- Possible wrong order of on_destroy calls HOT 3
- Feature request: Make 'entt::null' available in <entt/entity/fwd.hpp> HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from entt.