summaryrefslogtreecommitdiff
path: root/source/sourcemod/scripting/gokz-core/demofix.sp
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-04-25 22:46:52 +0200
committeraura <nw@moneybot.cc>2026-04-25 22:46:52 +0200
commit216c729c8762f4d0388d8750905a91fe1de64ccf (patch)
tree72f0f2f201f7156f220a46a1837c2768abdbb278 /source/sourcemod/scripting/gokz-core/demofix.sp
parent6018b8161bdc2bc7eee15500fbd9658d8ad0fc3f (diff)
wip on removing gokz gamemode features
Diffstat (limited to 'source/sourcemod/scripting/gokz-core/demofix.sp')
-rw-r--r--source/sourcemod/scripting/gokz-core/demofix.sp47
1 files changed, 5 insertions, 42 deletions
diff --git a/source/sourcemod/scripting/gokz-core/demofix.sp b/source/sourcemod/scripting/gokz-core/demofix.sp
index 84a9307..3839fad 100644
--- a/source/sourcemod/scripting/gokz-core/demofix.sp
+++ b/source/sourcemod/scripting/gokz-core/demofix.sp
@@ -8,7 +8,7 @@ void OnPluginStart_Demofix()
CV_EnableDemofix = AutoExecConfig_CreateConVar("gokz_demofix", "1", "Whether GOKZ applies demo record fix to server. (0 = Disabled, 1 = Update warmup period once, 2 = Regularly reset warmup period)", _, true, 0.0, true, 2.0);
CV_EnableDemofix.AddChangeHook(OnDemofixConVarChanged);
// If the map is tweaking the warmup value, we need to rerun the fix again.
- FindConVar("mp_warmuptime").AddChangeHook(OnDemofixConVarChanged);
+ // FindConVar("mp_warmuptime").AddChangeHook(OnDemofixConVarChanged);
// We assume that the map is already loaded on late load.
if (gB_LateLoad)
{
@@ -28,7 +28,7 @@ void OnMapEnd_Demofix()
void OnRoundStart_Demofix()
{
- DoDemoFix();
+ // DoDemoFix();
}
public Action Command_Demorestart(int client, const char[] command, int argc)
@@ -53,7 +53,7 @@ static void FixRecord(int client)
public void OnDemofixConVarChanged(ConVar convar, const char[] oldValue, const char[] newValue)
{
- DoDemoFix();
+ // DoDemoFix();
}
public Action Timer_EnableDemoRecord(Handle timer)
@@ -64,47 +64,10 @@ public Action Timer_EnableDemoRecord(Handle timer)
static void DoDemoFix()
{
- if (H_DemofixTimer != null)
- {
- delete H_DemofixTimer;
- }
- // Setting the cvar value to 1 can avoid clogging the demo file and slightly increase performance.
- switch (CV_EnableDemofix.IntValue)
- {
- case 0:
- {
- if (!mapRunning)
- {
- return;
- }
- GameRules_SetProp("m_bWarmupPeriod", 0);
- }
- case 1:
- {
- // Set warmup time to 2^31-1, effectively forever
- if (FindConVar("mp_warmuptime").IntValue != 2147483647)
- {
- FindConVar("mp_warmuptime").SetInt(2147483647);
- }
- EnableDemoRecord();
- }
- case 2:
- {
- H_DemofixTimer = CreateTimer(1.0, Timer_EnableDemoRecord, _, TIMER_REPEAT);
- }
- }
}
static void EnableDemoRecord()
{
- // Enable warmup to allow demo recording
- // m_fWarmupPeriodEnd is set in the past to hide the timer UI
- if (!mapRunning)
- {
- return;
- }
- GameRules_SetProp("m_bWarmupPeriod", 1);
- GameRules_SetPropFloat("m_fWarmupPeriodStart", GetGameTime() - 1.0);
- GameRules_SetPropFloat("m_fWarmupPeriodEnd", GetGameTime() - 1.0);
-} \ No newline at end of file
+
+}