aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/client/audio.cpp
diff options
context:
space:
mode:
authorF1F7Y <64418963+F1F7Y@users.noreply.github.com>2023-10-10 02:28:32 +0200
committerGitHub <noreply@github.com>2023-10-10 02:28:32 +0200
commitc1745b29ad4cae0279d905265cd3eadf79c46e12 (patch)
treeff24934493e6cc2d95cc7172adc69f6bab242d1e /NorthstarDLL/client/audio.cpp
parenta040bff98c16b79a3e817af441a795cf4f407069 (diff)
downloadNorthstarLauncher-c1745b29ad4cae0279d905265cd3eadf79c46e12.tar.gz
NorthstarLauncher-c1745b29ad4cae0279d905265cd3eadf79c46e12.zip
Add `mileslog_enable` convar (#515)v1.19.6-rc1
Adds a convar to toggle whether we should log from the miles log func Most of these warnings are warnings about events being starved, in some cases slowing down the game due to the number of log calls.
Diffstat (limited to 'NorthstarDLL/client/audio.cpp')
-rw-r--r--NorthstarDLL/client/audio.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/NorthstarDLL/client/audio.cpp b/NorthstarDLL/client/audio.cpp
index 9fcac982..66d34404 100644
--- a/NorthstarDLL/client/audio.cpp
+++ b/NorthstarDLL/client/audio.cpp
@@ -16,6 +16,7 @@ extern "C"
extern void* __fastcall Audio_GetParentEvent();
}
+ConVar* Cvar_mileslog_enable;
ConVar* Cvar_ns_print_played_sounds;
CustomAudioManager g_CustomAudioManager;
@@ -494,9 +495,17 @@ AUTOHOOK(MilesLog, client.dll + 0x57DAD0,
void, __fastcall, (int level, const char* string))
// clang-format on
{
+ if (!Cvar_mileslog_enable->GetBool())
+ return;
+
spdlog::info("[MSS] {} - {}", level, string);
}
+ON_DLL_LOAD_RELIESON("engine.dll", MilesLogFuncHooks, ConVar, (CModule module))
+{
+ Cvar_mileslog_enable = new ConVar("mileslog_enable", "0", FCVAR_NONE, "Enables/disables whether the mileslog func should be logged");
+}
+
ON_DLL_LOAD_CLIENT_RELIESON("client.dll", AudioHooks, ConVar, (CModule module))
{
AUTOHOOK_DISPATCH()