From 01da3cecf2c8d998d4e4caa424635b15bdab4189 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Tue, 13 Sep 2022 10:06:42 +0200 Subject: Revert "Revert "allow mods to load biks that aren't already present in r2/media (#137)"" This reverts commit 88c82bc30fe11fcfa28646bb2720266e023e2e23. --- NorthstarDLL/clientvideooverrides.cpp | 7 ++++++- NorthstarDLL/clientvideooverrides.h | 2 +- NorthstarDLL/dllmain.cpp | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/NorthstarDLL/clientvideooverrides.cpp b/NorthstarDLL/clientvideooverrides.cpp index c5989968..659bf23c 100644 --- a/NorthstarDLL/clientvideooverrides.cpp +++ b/NorthstarDLL/clientvideooverrides.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "clientvideooverrides.h" #include "modmanager.h" +#include "nsmem.h" typedef void* (*BinkOpenType)(const char* path, uint32_t flags); BinkOpenType BinkOpen; @@ -31,8 +32,12 @@ void* BinkOpenHook(const char* path, uint32_t flags) return BinkOpen(path, flags); } -void InitialiseClientVideoOverrides(HMODULE baseAddress) +void InitialiseEngineClientVideoOverrides(HMODULE baseAddress) { + // remove engine check for whether the bik we're trying to load exists in r2/media, as this will fail for biks in mods + // note: the check in engine is actually unnecessary, so it's just useless in practice and we lose nothing by removing it + NSMem::NOP((uintptr_t)baseAddress + 0x459AD, 6); + HookEnabler hook; ENABLER_CREATEHOOK( hook, diff --git a/NorthstarDLL/clientvideooverrides.h b/NorthstarDLL/clientvideooverrides.h index 8819e404..a5e961f5 100644 --- a/NorthstarDLL/clientvideooverrides.h +++ b/NorthstarDLL/clientvideooverrides.h @@ -1,2 +1,2 @@ #pragma once -void InitialiseClientVideoOverrides(HMODULE baseAddress); \ No newline at end of file +void InitialiseEngineClientVideoOverrides(HMODULE baseAddress); \ No newline at end of file diff --git a/NorthstarDLL/dllmain.cpp b/NorthstarDLL/dllmain.cpp index 6d32034f..02b3fefc 100644 --- a/NorthstarDLL/dllmain.cpp +++ b/NorthstarDLL/dllmain.cpp @@ -253,7 +253,7 @@ bool InitialiseNorthstar() AddDllLoadCallbackForClient("client.dll", InitialiseClientChatHooks); AddDllLoadCallbackForClient("client.dll", InitialiseLocalChatWriter); AddDllLoadCallbackForClient("client.dll", InitialiseScriptServerToClientStringCommands); - AddDllLoadCallbackForClient("client.dll", InitialiseClientVideoOverrides); + AddDllLoadCallbackForClient("engine.dll", InitialiseEngineClientVideoOverrides); AddDllLoadCallbackForClient("engine.dll", InitialiseEngineClientRUIHooks); AddDllLoadCallbackForClient("engine.dll", InitialiseDebugOverlay); AddDllLoadCallbackForClient("client.dll", InitialiseClientSquirrelUtilityFunctions); -- cgit v1.2.3