diff options
author | Chaosus <chaosus89@gmail.com> | 2018-08-20 11:25:48 +0300 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2018-08-22 00:11:53 +0200 |
commit | 27731a86d2003e0b98a217d191dc7e180ddf043b (patch) | |
tree | c29621e317f4d944d2c26b4b427988d0345bbe62 /scene/2d | |
parent | a3fe19dd109c1d689d74e14ba6ff60929653d4c9 (diff) |
Restrict set_pitch_scale to positive scales for AudioStreamPlayer*
Fixes #20459.
Co-authored-by: Tiago José Sousa Magalhães <crakylps@gmail.com>
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/audio_stream_player_2d.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index 507499a324..559e041dbf 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -296,6 +296,7 @@ float AudioStreamPlayer2D::get_volume_db() const { } void AudioStreamPlayer2D::set_pitch_scale(float p_pitch_scale) { + ERR_FAIL_COND(p_pitch_scale <= 0.0); pitch_scale = p_pitch_scale; } float AudioStreamPlayer2D::get_pitch_scale() const { |