From f230156cbebc1b93db5e254410ee2ab3a8dcb27c Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Mon, 9 May 2022 00:40:53 +0100 Subject: use in-file macros rather than global funcs for registering dll load callbacks --- NorthstarDedicatedTest/audio.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'NorthstarDedicatedTest/audio.cpp') diff --git a/NorthstarDedicatedTest/audio.cpp b/NorthstarDedicatedTest/audio.cpp index 0b65670f..982e42ab 100644 --- a/NorthstarDedicatedTest/audio.cpp +++ b/NorthstarDedicatedTest/audio.cpp @@ -1,4 +1,5 @@ #include "pch.h" +#include "hooks.h" #include "audio.h" #include "dedicated.h" @@ -493,7 +494,7 @@ void __fastcall MilesLog_Hook(int level, const char* string) spdlog::info("[MSS] {} - {}", level, string); } -void InitialiseMilesAudioHooks(HMODULE baseAddress) +ON_DLL_LOAD_CLIENT_RELIESON("client.dll", AudioHooks, ConVar, (HMODULE baseAddress) { Cvar_ns_print_played_sounds = new ConVar("ns_print_played_sounds", "0", FCVAR_NONE, ""); @@ -512,4 +513,4 @@ void InitialiseMilesAudioHooks(HMODULE baseAddress) ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x57DAD0, &MilesLog_Hook, reinterpret_cast(&MilesLog_Original)); MilesStopAll = (MilesStopAll_Type)((char*)baseAddress + 0x580850); -} \ No newline at end of file +}) \ No newline at end of file -- cgit v1.2.3