Mitigate crash in AudioStreamPlayer3D when a camera has null viewport
This commit is contained in:
parent
fa3164e90c
commit
601a0722a7
1 changed files with 6 additions and 0 deletions
|
@ -383,7 +383,13 @@ Vector<AudioFrame> AudioStreamPlayer3D::_update_panning() {
|
|||
PhysicsDirectSpaceState3D *space_state = PhysicsServer3D::get_singleton()->space_get_direct_state(world_3d->get_space());
|
||||
|
||||
for (Camera3D *camera : cameras) {
|
||||
if (!camera) {
|
||||
continue;
|
||||
}
|
||||
Viewport *vp = camera->get_viewport();
|
||||
if (!vp) {
|
||||
continue;
|
||||
}
|
||||
if (!vp->is_audio_listener_3d()) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue