aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/dedicatedmaterialsystem.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-03 20:55:19 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-03 20:55:19 +0000
commit9e8232e97db1cfe9f0f9a69bdfde5048a6290df1 (patch)
treebe1324c39dd1680335f4bfaf3d1660b5d6e31514 /NorthstarDedicatedTest/dedicatedmaterialsystem.cpp
parentf33bab4fb3586fd06896a7730bce8913c2616b78 (diff)
downloadNorthstarLauncher-9e8232e97db1cfe9f0f9a69bdfde5048a6290df1.tar.gz
NorthstarLauncher-9e8232e97db1cfe9f0f9a69bdfde5048a6290df1.zip
slightly awful fix for allocation issues
Diffstat (limited to 'NorthstarDedicatedTest/dedicatedmaterialsystem.cpp')
-rw-r--r--NorthstarDedicatedTest/dedicatedmaterialsystem.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/NorthstarDedicatedTest/dedicatedmaterialsystem.cpp b/NorthstarDedicatedTest/dedicatedmaterialsystem.cpp
index 29ccf6f7..758f0527 100644
--- a/NorthstarDedicatedTest/dedicatedmaterialsystem.cpp
+++ b/NorthstarDedicatedTest/dedicatedmaterialsystem.cpp
@@ -129,7 +129,7 @@ void* RegisterRpakTypeHook(RpakTypeDefinition* rpakStruct, unsigned int a1, unsi
spdlog::info("rpak type {} {} registered", magicName, rpakStruct->longName);
// reregister rpak types that aren't registered on a windowless dedi
- if (IsDedicated() && DisableDedicatedWindowCreation() && rpakStruct->magic == 0x64636C72) // rlcd magic, this one is registered last
+ if (rpakStruct->magic == 0x64636C72) // rlcd magic, this one is registered last
((RegisterMaterialSystemRpakTypes)((char*)GetModuleHandleA("materialsystem_dx11.dll") + 0x22A0))(); // slightly hellish call, registers materialsystem rpak types
return RegisterRpakType(rpakStruct, a1, a2);
@@ -137,13 +137,9 @@ void* RegisterRpakTypeHook(RpakTypeDefinition* rpakStruct, unsigned int a1, unsi
void InitialiseDedicatedRtechGame(HMODULE baseAddress)
{
- // potentially do this somewhere other than dedicated stuff if it's going to be used in non-dedi
+ if (!IsDedicated() || !DisableDedicatedWindowCreation())
+ return;
HookEnabler hook;
ENABLER_CREATEHOOK(hook, (char*)GetModuleHandleA("rtech_game.dll") + 0x7BE0, &RegisterRpakTypeHook, reinterpret_cast<LPVOID*>(&RegisterRpakType));
-
- if (!IsDedicated())
- return;
-
-
} \ No newline at end of file