Merge pull request #55544 from V-Sekai/audio_camera_null_mitigation

This commit is contained in:
Rémi Verschelde 2021-12-06 14:19:40 +01:00 committed by GitHub
commit ede7614fe2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -391,7 +391,13 @@ Vector<AudioFrame> AudioStreamPlayer3D::_update_panning() {
PhysicsDirectSpaceState3D *space_state = PhysicsServer3D::get_singleton()->space_get_direct_state(world_3d->get_space()); PhysicsDirectSpaceState3D *space_state = PhysicsServer3D::get_singleton()->space_get_direct_state(world_3d->get_space());
for (Camera3D *camera : cameras) { for (Camera3D *camera : cameras) {
if (!camera) {
continue;
}
Viewport *vp = camera->get_viewport(); Viewport *vp = camera->get_viewport();
if (!vp) {
continue;
}
if (!vp->is_audio_listener_3d()) { if (!vp->is_audio_listener_3d()) {
continue; continue;
} }