From 043729cf3206183c2ad0a6d2337202e526c603cf Mon Sep 17 00:00:00 2001 From: SaiyansKing <38609240+SaiyansKing@users.noreply.github.com> Date: Sun, 18 Jun 2023 12:09:34 +0200 Subject: [PATCH] Fix hooking zCActiveSndAutoCalcObstruction --- D3D11Engine/DLLMain.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/D3D11Engine/DLLMain.cpp b/D3D11Engine/DLLMain.cpp index 9f8d9fc9..a63ea182 100644 --- a/D3D11Engine/DLLMain.cpp +++ b/D3D11Engine/DLLMain.cpp @@ -217,7 +217,9 @@ int WINAPI hooked_WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR l // Remove automatic volume change of sounds regarding whether the camera is indoor or outdoor // TODO: Implement! if ( !GMPModeActive ) { + DetourTransactionBegin(); DetourAttach( &reinterpret_cast(HookedFunctions::OriginalFunctions.original_zCActiveSndAutoCalcObstruction), HookedFunctionInfo::hooked_zCActiveSndAutoCalcObstruction ); + DetourTransactionCommit(); } return originalWinMain( hInstance, hPrevInstance, lpCmdLine, nShowCmd ); }