Closed zwazel closed 1 year ago
I have updated my Example in my Fork to showcase the issue:
The example now immediately despawns the entity after calling "on_update" once. The "on_test" is still being called by the scripts, even though their entity doesn't exist anymore.
I was experimenting a little bit, and interestingly in my example, out of the 10 entities, the context is only being removed from 9. so the "on_test" is called on only 1 of them.
Updated the example again that shows this.
okay, there seems to be a problem in my own logic. the crate does it as expected, now i just need to find my issue. the example will be shortly updated, it works as intended
Okay, nope. there is indeed a bug.
(sorry for all the messages...)
Haha, you're right there is a bug, and it's really weird I haven't seen this before, guess I haven't had a situation where entity id != script Id and then I removed it? very good catch thanks!
I despawn an entity (recursively) that has a script attached to it. but the script still "exists" and receives the events.
I'm currently only working with the Rhai implementation, so idk if this is a general problem or not. but its definitely not what i expect it to work like XD