From 2171d95e1221442081bade7929c05b82ca0f2a08 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Thu, 26 May 2022 23:09:15 +0100 Subject: update more stuff to new hook macros --- NorthstarDedicatedTest/buildainfile.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'NorthstarDedicatedTest/buildainfile.cpp') diff --git a/NorthstarDedicatedTest/buildainfile.cpp b/NorthstarDedicatedTest/buildainfile.cpp index ea9d69ef..a80185e5 100644 --- a/NorthstarDedicatedTest/buildainfile.cpp +++ b/NorthstarDedicatedTest/buildainfile.cpp @@ -1,8 +1,10 @@ #include "pch.h" #include "convar.h" +#include "hoststate.h" +#include "NSMem.h" + #include #include -#include "NSMem.h" AUTOHOOK_INIT() @@ -161,14 +163,13 @@ struct CAI_Network }; char** pUnkServerMapversionGlobal; -char* pMapName; ConVar* Cvar_ns_ai_dumpAINfileFromLoad; void DumpAINInfo(CAI_Network* aiNetwork) { fs::path writePath("r2/maps/graphs"); - writePath /= pMapName; + writePath /= R2::g_pHostState->m_levelName; writePath += ".ain"; // dump from memory @@ -370,14 +371,14 @@ void,, (void* aimanager, void* buf, const char* filename), ON_DLL_LOAD("server.dll", BuildAINFile, [](HMODULE baseAddress) { + AUTOHOOK_DISPATCH() + Cvar_ns_ai_dumpAINfileFromLoad = new ConVar( "ns_ai_dumpAINfileFromLoad", "0", FCVAR_NONE, "For debugging: whether we should dump ain data for ains loaded from disk"); pUnkStruct0Count = (int*)((char*)baseAddress + 0x1063BF8); pppUnkNodeStruct0s = (UnkNodeStruct0***)((char*)baseAddress + 0x1063BE0); - pUnkLinkStruct1Count = (int*)((char*)baseAddress + 0x1063AA8); pppUnkStruct1s = (UnkLinkStruct1***)((char*)baseAddress + 0x1063A90); pUnkServerMapversionGlobal = (char**)((char*)baseAddress + 0xBFBE08); - pMapName = (char*)baseAddress + 0x1053370; }); \ No newline at end of file -- cgit v1.2.3