diff options
author | p0358 <p0358@users.noreply.github.com> | 2021-12-31 22:46:45 +0100 |
---|---|---|
committer | p0358 <p0358@users.noreply.github.com> | 2021-12-31 22:46:45 +0100 |
commit | 9b13df7bc6f4c09c3fdab27cd51fe76d30b756b8 (patch) | |
tree | d273fbc7942b46497f056fd9c68b8b21e6d19fee /NorthstarDedicatedTest/gameutils.cpp | |
parent | dcba96bcc4b02639e859b0dcdc863391cb54684f (diff) | |
download | NorthstarLauncher-9b13df7bc6f4c09c3fdab27cd51fe76d30b756b8.tar.gz NorthstarLauncher-9b13df7bc6f4c09c3fdab27cd51fe76d30b756b8.zip |
some post-merge changes combined with my local changes
Diffstat (limited to 'NorthstarDedicatedTest/gameutils.cpp')
-rw-r--r-- | NorthstarDedicatedTest/gameutils.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/NorthstarDedicatedTest/gameutils.cpp b/NorthstarDedicatedTest/gameutils.cpp index b2c88e49..1cbd8648 100644 --- a/NorthstarDedicatedTest/gameutils.cpp +++ b/NorthstarDedicatedTest/gameutils.cpp @@ -78,6 +78,13 @@ void InitialiseServerGameUtilFunctions(HMODULE baseAddress) void InitialiseTier0GameUtilFunctions(HMODULE baseAddress) { + if (!baseAddress) + { + spdlog::critical("tier0 base address is null, but it should be already loaded"); + throw "tier0 base address is null, but it should be already loaded"; + } + if (g_pMemAllocSingleton) + return; // seems this function was already called CreateGlobalMemAlloc = reinterpret_cast<CreateGlobalMemAllocType>(GetProcAddress(baseAddress, "CreateGlobalMemAlloc")); IMemAlloc** ppMemAllocSingleton = reinterpret_cast<IMemAlloc**>(GetProcAddress(baseAddress, "g_pMemAllocSingleton")); if (!ppMemAllocSingleton) @@ -89,7 +96,7 @@ void InitialiseTier0GameUtilFunctions(HMODULE baseAddress) { g_pMemAllocSingleton = CreateGlobalMemAlloc(); *ppMemAllocSingleton = g_pMemAllocSingleton; - spdlog::warn("Created new g_pMemAllocSingleton"); + spdlog::info("Created new g_pMemAllocSingleton"); } else { |