diff options
author | hoontee <5272529+hoontee@users.noreply.github.com> | 2020-05-07 02:23:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 02:23:50 -0500 |
commit | 330bd686ab6068f51b536d7f351a8c6641300749 (patch) | |
tree | 325046e0cafc71101bd5a31d4354b7a75f61c30d | |
parent | 1ff97485dfc5bc74ea7a81038a57693cd77593eb (diff) |
Fix bug with AudioStreamPlayer3D audio position
Applies https://github.com/godotengine/godot/commit/0c78a58b6472f704d473e0307c9ea83dfbde1811 to `AudioStreamPlayer3D::play`.
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index f2395d35fb..5701d3cea2 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -710,6 +710,11 @@ float AudioStreamPlayer3D::get_pitch_scale() const { void AudioStreamPlayer3D::play(float p_from_pos) { + if (!is_playing()) { + // Reset the prev_output_count if the stream is stopped + prev_output_count = 0; + } + if (stream_playback.is_valid()) { active = true; setplay = p_from_pos; |