From 1d3d7f598467e65654c0a79bb9c192801222e20d Mon Sep 17 00:00:00 2001 From: Tristan Grespinet Date: Tue, 19 Mar 2024 17:32:39 +0100 Subject: [PATCH] Remove listener update when in editor (#206) --- src/fmod_server.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/fmod_server.cpp b/src/fmod_server.cpp index ee8fcf48..951ab9a3 100644 --- a/src/fmod_server.cpp +++ b/src/fmod_server.cpp @@ -1,3 +1,4 @@ +#include "classes/engine.hpp" #include "core/fmod_sound.h" #include "data/performance_data.h" #include "helpers/common.h" @@ -230,8 +231,16 @@ void FmodServer::update() { if (!event->is_valid()) { runningEvents.erase(event); } } - _set_listener_attributes(); - _update_performance_data(); +#ifdef TOOLS_ENABLED + if (!Engine::get_singleton()->is_editor_hint()) { +#endif + // Editor only needs to run the server for events preview in the explorer. + // We don't need to update performance_data and listeners + _set_listener_attributes(); + _update_performance_data(); +#ifdef TOOLS_ENABLED + } +#endif ERROR_CHECK(system->update()); }