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

Fix trigger crash #6926

Merged
merged 5 commits into from
Sep 8, 2024
Merged

Fix trigger crash #6926

merged 5 commits into from
Sep 8, 2024

Conversation

LeXXik
Copy link
Contributor

@LeXXik LeXXik commented Sep 8, 2024

Fixes #2572

Prevents adding a trigger to the dynamics world, if it is already there.

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

@LeXXik
Copy link
Contributor Author

LeXXik commented Sep 8, 2024

For some reason, when I originally was writing it, indexOf was returning me -1, so I went with find. Probably was debug console cache issue or something.

@willeastcott
Copy link
Contributor

@LeXXik I've tweaked the code to make enable and disable more symmetrical. Let me know what you think.

@LeXXik
Copy link
Contributor Author

LeXXik commented Sep 8, 2024

@willeastcott looks good. Even though removing a body from world if it is not there should be "safe", there is no harm in additional check.

@willeastcott willeastcott self-assigned this Sep 8, 2024
@willeastcott willeastcott added area: physics Physics related issue bug labels Sep 8, 2024
@willeastcott willeastcott merged commit 9862abd into playcanvas:main Sep 8, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: physics Physics related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloning an trigger and enabling/disabling the clone many times in the same frame causes Ammo crash
2 participants