Restrict set_pitch_scale to positive scales for AudioStreamPlayer*

Fixes #20459.

Co-authored-by: Tiago José Sousa Magalhães <crakylps@gmail.com>
This commit is contained in:
Chaosus
2018-08-20 11:25:48 +03:00
committed by Rémi Verschelde
parent a3fe19dd10
commit 27731a86d2
5 changed files with 7 additions and 4 deletions

View File

@ -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 {