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

Add a property hint to fix crash when setting max convex hulls below 0 #73687

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Feb 21, 2023

Generating less than 1 convex hull is not valid anyway.

I assume generating more than 100 convex shapes for a single mesh would be ill-advised, so I've set the maximum value to that.

@akien-mga
Copy link
Member

Looks good, but I would also add an ERR_FAIL_COND where it's used to make sure invalid .import files don't trigger a crash.

@akien-mga
Copy link
Member

Looks good, but I would also add an ERR_FAIL_COND where it's used to make sure invalid .import files don't trigger a crash.

Amended the commit, added a MAX(1, ...) instead as I'm not sure it would handle an early return gracefully, and it's an edge case where the value would be invalid in the .import file.

Generating less than 1 convex hull is not valid anyway.
@akien-mga akien-mga force-pushed the editor-convex-import-fix-max-convex-hulls-crash branch from 7fbc110 to 7899726 Compare February 23, 2023 12:51
@akien-mga akien-mga merged commit 873c507 into godotengine:master Feb 23, 2023
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants