aboutsummaryrefslogtreecommitdiff
path: root/primedev/client/demofixes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'primedev/client/demofixes.cpp')
-rw-r--r--primedev/client/demofixes.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/primedev/client/demofixes.cpp b/primedev/client/demofixes.cpp
new file mode 100644
index 00000000..344764ba
--- /dev/null
+++ b/primedev/client/demofixes.cpp
@@ -0,0 +1,25 @@
+#include "core/convar/convar.h"
+
+ON_DLL_LOAD_CLIENT("engine.dll", EngineDemoFixes, (CModule module))
+{
+ // allow demo recording on loopback
+ module.Offset(0x8E1B1).NOP(2);
+ module.Offset(0x56CC3).NOP(2);
+}
+
+ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ClientDemoFixes, ConVar, (CModule module))
+{
+ // 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 = g_pCVar->FindVar("demo_enabledemos");
+ Cvar_demo_enableDemos->m_pszDefaultValue = "1";
+ Cvar_demo_enableDemos->SetValue(true);
+
+ ConVar* Cvar_demo_writeLocalFile = g_pCVar->FindVar("demo_writeLocalFile");
+ Cvar_demo_writeLocalFile->m_pszDefaultValue = "1";
+ Cvar_demo_writeLocalFile->SetValue(true);
+
+ ConVar* Cvar_demo_autoRecord = g_pCVar->FindVar("demo_autoRecord");
+ Cvar_demo_autoRecord->m_pszDefaultValue = "0";
+ Cvar_demo_autoRecord->SetValue(false);
+}