Fix bug with viewport not correctly setting audio listener 2d

This commit is contained in:
Fabio Alessandrelli 2017-05-05 01:21:45 +02:00
parent 17619b5420
commit 2665460390
1 changed files with 1 additions and 1 deletions

View File

@ -697,7 +697,7 @@ void Viewport::_update_listener() {
void Viewport::_update_listener_2d() { void Viewport::_update_listener_2d() {
if (is_inside_tree() && audio_listener && (!get_parent() || (get_parent()->cast_to<Control>() && get_parent()->cast_to<Control>()->is_visible()))) if (is_inside_tree() && audio_listener_2d && (!get_parent() || (get_parent()->cast_to<Control>() && get_parent()->cast_to<Control>()->is_visible())))
SpatialSound2DServer::get_singleton()->listener_set_space(internal_listener_2d, find_world_2d()->get_sound_space()); SpatialSound2DServer::get_singleton()->listener_set_space(internal_listener_2d, find_world_2d()->get_sound_space());
else else
SpatialSound2DServer::get_singleton()->listener_set_space(internal_listener_2d, RID()); SpatialSound2DServer::get_singleton()->listener_set_space(internal_listener_2d, RID());