-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 for NaN in set_volume_db
functions
#90861
Check for NaN in set_volume_db
functions
#90861
Conversation
Added check in AudioStreamPlayer, AudioStreamPlayer2D, and AudioStreamPlayer3D set_volume_db functions to prevent setting volume to NaN, and give an error. Using NaN for volume and playing the AudioStreamPlayer could prevent all audio from playing, even from other AudioStreamPlayers. Fixes godotengine#88133
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about is_finite()? Like would you also want to block infinities?
Agreed, should check |
Using infinite numbers does not break anything, only NaNs. |
Are you sure? There's no maths there that generates |
I mean I tested what happens when you set |
Then let's keep it NaN and see if something breaks down the line, though I'd prefer to keep it to just finites as it doesn't make sense to have infinites |
Thanks! |
Added check in
AudioStreamPlayer
,AudioStreamPlayer2D
, andAudioStreamPlayer3D
set_volume_db
functions to prevent setting volume to NaN, and give an error. Using NaN for volume and playing the AudioStreamPlayer could prevent all audio from playing, even from other AudioStreamPlayers.Fixes #88133