summaryrefslogtreecommitdiff
path: root/scene/audio
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/audio
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/audio')
-rw-r--r--scene/audio/audio_player.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/audio/audio_player.cpp b/scene/audio/audio_player.cpp
index 863b278b62..7a9f2bd8d0 100644
--- a/scene/audio/audio_player.cpp
+++ b/scene/audio/audio_player.cpp
@@ -192,6 +192,7 @@ float AudioStreamPlayer::get_volume_db() const {
}
void AudioStreamPlayer::set_pitch_scale(float p_pitch_scale) {
+ ERR_FAIL_COND(p_pitch_scale <= 0.0);
pitch_scale = p_pitch_scale;
}
float AudioStreamPlayer::get_pitch_scale() const {