aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-08-20 19:19:43 +0100
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-08-25 21:29:44 +0200
commit09bc8a4ed28d762244ccae22ae6a8e6c210ea960 (patch)
treef1c6d2193e54b746a70bc8e7a091d78e39fbb900 /NorthstarDedicatedTest
parent8b26d4a857937094e36a692c85501406e69aed0e (diff)
downloadNorthstarLauncher-09bc8a4ed28d762244ccae22ae6a8e6c210ea960.tar.gz
NorthstarLauncher-09bc8a4ed28d762244ccae22ae6a8e6c210ea960.zip
allow mods to load biks that aren't already present in r2/media (#137)
Co-authored-by: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>
Diffstat (limited to 'NorthstarDedicatedTest')
-rw-r--r--NorthstarDedicatedTest/clientvideooverrides.cpp7
-rw-r--r--NorthstarDedicatedTest/clientvideooverrides.h2
-rw-r--r--NorthstarDedicatedTest/dllmain.cpp2
3 files changed, 8 insertions, 3 deletions
diff --git a/NorthstarDedicatedTest/clientvideooverrides.cpp b/NorthstarDedicatedTest/clientvideooverrides.cpp
index c5989968..659bf23c 100644
--- a/NorthstarDedicatedTest/clientvideooverrides.cpp
+++ b/NorthstarDedicatedTest/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/NorthstarDedicatedTest/clientvideooverrides.h b/NorthstarDedicatedTest/clientvideooverrides.h
index 8819e404..a5e961f5 100644
--- a/NorthstarDedicatedTest/clientvideooverrides.h
+++ b/NorthstarDedicatedTest/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/NorthstarDedicatedTest/dllmain.cpp b/NorthstarDedicatedTest/dllmain.cpp
index 6d32034f..02b3fefc 100644
--- a/NorthstarDedicatedTest/dllmain.cpp
+++ b/NorthstarDedicatedTest/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);