diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2023-02-12 21:15:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-12 21:15:00 +0000 |
commit | 95b41b6f8cc612953eafd7f8b6b40124e1590bc7 (patch) | |
tree | 400746bace6855c210e020a5ca93b84c2fdd0dc9 /NorthstarDLL/server/buildainfile.cpp | |
parent | b61ed18a86ddd2d7ab0e80992859750a49a9c4f6 (diff) | |
download | NorthstarLauncher-95b41b6f8cc612953eafd7f8b6b40124e1590bc7.tar.gz NorthstarLauncher-95b41b6f8cc612953eafd7f8b6b40124e1590bc7.zip |
Add `CGlobals` class and `g_pGlobals`, and update code to support (#411)
* add CGlobals class and g_pGlobals, and update scripts to support
* don't automatically enable antispeedhack (oops)
* add dedicated.cpp
* format
* bad push oops
* reformat again
Diffstat (limited to 'NorthstarDLL/server/buildainfile.cpp')
-rw-r--r-- | NorthstarDLL/server/buildainfile.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/NorthstarDLL/server/buildainfile.cpp b/NorthstarDLL/server/buildainfile.cpp index f6dc4717..d1150a6b 100644 --- a/NorthstarDLL/server/buildainfile.cpp +++ b/NorthstarDLL/server/buildainfile.cpp @@ -174,14 +174,12 @@ struct CAI_Network }; #pragma pack(pop) -char** pUnkServerMapversionGlobal; - ConVar* Cvar_ns_ai_dumpAINfileFromLoad; void DumpAINInfo(CAI_Network* aiNetwork) { fs::path writePath(fmt::format("{}/maps/graphs", R2::g_pModName)); - writePath /= R2::g_pHostState->m_levelName; + writePath /= R2::g_pGlobals->m_pMapName; writePath += ".ain"; // dump from memory @@ -196,9 +194,8 @@ void DumpAINInfo(CAI_Network* aiNetwork) spdlog::info("writing ainet version: {}", AINET_VERSION_NUMBER); writeStream.write((char*)&AINET_VERSION_NUMBER, sizeof(int)); - // could probably be cleaner but whatever - int mapVersion = *(int*)(*pUnkServerMapversionGlobal + 104); - spdlog::info("writing map version: {}", mapVersion); // temp + int mapVersion = R2::g_pGlobals->m_nMapVersion; + spdlog::info("writing map version: {}", mapVersion); writeStream.write((char*)&mapVersion, sizeof(int)); spdlog::info("writing placeholder crc: {}", PLACEHOLDER_CRC); writeStream.write((char*)&PLACEHOLDER_CRC, sizeof(int)); @@ -396,5 +393,4 @@ ON_DLL_LOAD("server.dll", BuildAINFile, (CModule module)) pppUnkNodeStruct0s = module.Offset(0x1063BE0).As<UnkNodeStruct0***>(); pUnkLinkStruct1Count = module.Offset(0x1063AA8).As<int*>(); pppUnkStruct1s = module.Offset(0x1063A90).As<UnkLinkStruct1***>(); - pUnkServerMapversionGlobal = module.Offset(0xBFBE08).As<char**>(); } |