summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorChaosus <chaosus89@gmail.com>2018-08-20 11:25:48 +0300
committerRémi Verschelde <rverschelde@gmail.com>2018-08-22 00:11:53 +0200
commit27731a86d2003e0b98a217d191dc7e180ddf043b (patch)
treec29621e317f4d944d2c26b4b427988d0345bbe62 /scene/3d
parenta3fe19dd109c1d689d74e14ba6ff60929653d4c9 (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/3d')
-rw-r--r--scene/3d/audio_stream_player_3d.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index 5f0ac3dd80..8504a18f54 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -626,6 +626,7 @@ float AudioStreamPlayer3D::get_max_db() const {
}
void AudioStreamPlayer3D::set_pitch_scale(float p_pitch_scale) {
+ ERR_FAIL_COND(p_pitch_scale <= 0.0);
pitch_scale = p_pitch_scale;
}
float AudioStreamPlayer3D::get_pitch_scale() const {