diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-05-27 01:13:14 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-05-27 01:13:14 +0100 |
commit | 0de847bb4832c201233c87fa37867b9d89f0e8c8 (patch) | |
tree | f05add722b788d32aae40663e7748234452a3443 /NorthstarDLL/demofixes.cpp | |
parent | 2171d95e1221442081bade7929c05b82ca0f2a08 (diff) | |
download | NorthstarLauncher-0de847bb4832c201233c87fa37867b9d89f0e8c8.tar.gz NorthstarLauncher-0de847bb4832c201233c87fa37867b9d89f0e8c8.zip |
rename project folder (:tf: commit log)
Diffstat (limited to 'NorthstarDLL/demofixes.cpp')
-rw-r--r-- | NorthstarDLL/demofixes.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/NorthstarDLL/demofixes.cpp b/NorthstarDLL/demofixes.cpp new file mode 100644 index 00000000..ff06ae12 --- /dev/null +++ b/NorthstarDLL/demofixes.cpp @@ -0,0 +1,27 @@ +#include "pch.h" +#include "convar.h" +#include "NSMem.h" + +ON_DLL_LOAD_CLIENT("engine.dll", EngineDemoFixes, [](HMODULE baseAddress) +{ + // allow demo recording on loopback + NSMem::NOP((uintptr_t)baseAddress + 0x8E1B1, 2); + NSMem::NOP((uintptr_t)baseAddress + 0x56CC3, 2); +}) + +ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ClientDemoFixes, ConVar, [](HMODULE baseAddress) +{ + // change default values of demo cvars to enable them by default, but not autorecord + // this is before Host_Init, the setvalue calls here will get overwritten by custom cfgs/launch options + ConVar* Cvar_demo_enableDemos = R2::g_pCVar->FindVar("demo_enabledemos"); + Cvar_demo_enableDemos->m_pszDefaultValue = "1"; + Cvar_demo_enableDemos->SetValue(true); + + ConVar* Cvar_demo_writeLocalFile = R2::g_pCVar->FindVar("demo_writeLocalFile"); + Cvar_demo_writeLocalFile->m_pszDefaultValue = "1"; + Cvar_demo_writeLocalFile->SetValue(true); + + ConVar* Cvar_demo_autoRecord = R2::g_pCVar->FindVar("demo_autoRecord"); + Cvar_demo_autoRecord->m_pszDefaultValue = "0"; + Cvar_demo_autoRecord->SetValue(false); +})
\ No newline at end of file |