Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the isPlaying flag of the component when calling component behaviors #5516

Merged
merged 1 commit into from Apr 10, 2024

Conversation

mrxz
Copy link
Contributor

@mrxz mrxz commented Apr 9, 2024

Description:
This PR fixes a regression introduced in #5478, which was noticed by @vincentfretin in #5515. In short, behaviours would be marked for removal when they belong to a component that is currently having their tick/tock called. This works fine in case an entity is removed or if the removed components have already been called, but fails if they are yet to be called.

This PR simply changes the check in callComponentBehaviors from .el.isPlaying to .isPlaying as components with behaviours have this flag. Generally it matches the .el.isPlaying state, unless the component hasn't (fully) initialized yet or is removed from an entity. Those are precisely the cases where the bug could surface.

The related unit tests required some changes in setup as they used Components that weren't completely initialized or inline defined behaviours.

Fixes/supersedes #5515

Changes proposed:

  • Only call tick and tock on components that are currently playing

@vincentfretin
Copy link
Contributor

Thanks @mrxz you're the best!
I'm glad I found the issue myself and not during a demo with my customer :D

@dmarcos
Copy link
Member

dmarcos commented Apr 10, 2024

Thanks so much!

@dmarcos dmarcos merged commit d8ef657 into aframevr:master Apr 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants