mirror of
https://github.com/godotengine/godot.git
synced 2024-12-04 01:52:56 +00:00
Merge pull request #99759 from Mickeon/audio-stream-player-3d-seek-fix-for-real
Fix AudioStreamPlayer2D/3D's `get_playback_position` returning `0` right after calling `seek`
This commit is contained in:
commit
ca1440fafb
@ -253,6 +253,9 @@ bool AudioStreamPlayer2D::is_playing() const {
|
||||
}
|
||||
|
||||
float AudioStreamPlayer2D::get_playback_position() {
|
||||
if (setplay.get() >= 0) {
|
||||
return setplay.get(); // play() has been called this frame, but no playback exists just yet.
|
||||
}
|
||||
return internal->get_playback_position();
|
||||
}
|
||||
|
||||
|
@ -579,6 +579,9 @@ bool AudioStreamPlayer3D::is_playing() const {
|
||||
}
|
||||
|
||||
float AudioStreamPlayer3D::get_playback_position() {
|
||||
if (setplay.get() >= 0) {
|
||||
return setplay.get(); // play() has been called this frame, but no playback exists just yet.
|
||||
}
|
||||
return internal->get_playback_position();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user