aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDedicatedTest')
-rw-r--r--NorthstarDedicatedTest/languagehooks.cpp4
-rw-r--r--NorthstarDedicatedTest/miscserverfixes.cpp15
2 files changed, 17 insertions, 2 deletions
diff --git a/NorthstarDedicatedTest/languagehooks.cpp b/NorthstarDedicatedTest/languagehooks.cpp
index 08bacaf9..0929b73d 100644
--- a/NorthstarDedicatedTest/languagehooks.cpp
+++ b/NorthstarDedicatedTest/languagehooks.cpp
@@ -1,6 +1,7 @@
#include "pch.h"
#include "languagehooks.h"
#include "gameutils.h"
+#include "dedicated.h"
#include <filesystem>
#include <regex>
@@ -104,6 +105,9 @@ char* GetGameLanguageHook()
void InitialiseTier0LanguageHooks(HMODULE baseAddress)
{
+ if (IsDedicated())
+ return;
+
HookEnabler hook;
ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0xF560, &GetGameLanguageHook, reinterpret_cast<LPVOID*>(&GetGameLanguageOriginal));
} \ No newline at end of file
diff --git a/NorthstarDedicatedTest/miscserverfixes.cpp b/NorthstarDedicatedTest/miscserverfixes.cpp
index 2007a30c..5db9ebbd 100644
--- a/NorthstarDedicatedTest/miscserverfixes.cpp
+++ b/NorthstarDedicatedTest/miscserverfixes.cpp
@@ -6,8 +6,19 @@ void InitialiseMiscServerFixes(HMODULE baseAddress)
{
// ret at the start of the concommand GenerateObjFile as it can crash servers
{
- void* ptr = (char*)baseAddress + 0x38D920;
+ char* ptr = reinterpret_cast<char*>(baseAddress) + 0x38D920;
TempReadWrite rw(ptr);
- *((char*)ptr) = (char)0xC3;
+ *ptr = 0xC3;
+ }
+
+ // nop out call to VGUI shutdown since it crashes the game when quitting from the console
+ {
+ char* ptr = reinterpret_cast<char*>(baseAddress) + 0x154A96;
+ TempReadWrite rw(ptr);
+ *(ptr++) = 0x90; // nop
+ *(ptr++) = 0x90; // nop
+ *(ptr++) = 0x90; // nop
+ *(ptr++) = 0x90; // nop
+ *ptr = 0x90; // nop
}
} \ No newline at end of file