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

Don't allow negative values for OS.delay_usec()/OS.delay_msec() #46194

Merged
merged 1 commit into from
Feb 19, 2021

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Feb 18, 2021

This closes #46190.

PS: In the future, I think we should remove OS.delay_msec() since OS.delay_usec() can be used to accomplish the same task (just multiply its argument by 1000). This would limit the maximum delay you can apply from scripting to ~2147 seconds, but I think this should be sufficient.

@Calinou Calinou requested review from a team as code owners February 18, 2021 21:55
@Calinou Calinou added this to the 4.0 milestone Feb 18, 2021
core/core_bind.cpp Outdated Show resolved Hide resolved
@akien-mga
Copy link
Member

akien-mga commented Feb 18, 2021

PS: In the future, I think we should remove OS.delay_msec() since OS.delay_usec() can be used to accomplish the same task (just multiply its argument by 1000). This would limit the maximum delay you can apply from scripting to ~2147 seconds, but I think this should be sufficient.

I don't think it's a good idea, ms are more convenient to work with than µs IMO. I doubt many users actually use delay_usec directly. And limiting delay values to 2000 s seems a bit extreme, that's not even one hour.

@akien-mga akien-mga merged commit efddb8a into godotengine:master Feb 19, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Feb 19, 2021
@akien-mga
Copy link
Member

Cherry-picked for 3.2.4.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Feb 19, 2021
@Calinou Calinou deleted the os-delay-no-negative branch March 31, 2021 09:42
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.

Negative delay freeze Godot
2 participants