From 26654603900dc9d4c5f7d3bb98ff9fc2d13f4dde Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Fri, 5 May 2017 01:21:45 +0200 Subject: [PATCH] Fix bug with viewport not correctly setting audio listener 2d --- scene/main/viewport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index a1f9c87bfe7..73d1fed3b90 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -697,7 +697,7 @@ void Viewport::_update_listener() { void Viewport::_update_listener_2d() { - if (is_inside_tree() && audio_listener && (!get_parent() || (get_parent()->cast_to() && get_parent()->cast_to()->is_visible()))) + if (is_inside_tree() && audio_listener_2d && (!get_parent() || (get_parent()->cast_to() && get_parent()->cast_to()->is_visible()))) SpatialSound2DServer::get_singleton()->listener_set_space(internal_listener_2d, find_world_2d()->get_sound_space()); else SpatialSound2DServer::get_singleton()->listener_set_space(internal_listener_2d, RID());