From 216c729c8762f4d0388d8750905a91fe1de64ccf Mon Sep 17 00:00:00 2001 From: aura Date: Sat, 25 Apr 2026 22:46:52 +0200 Subject: wip on removing gokz gamemode features --- source/sourcemod/scripting/gokz-core/demofix.sp | 47 +++---------------------- source/sourcemod/scripting/gokz-core/misc.sp | 9 +++-- 2 files changed, 11 insertions(+), 45 deletions(-) (limited to 'source/sourcemod/scripting/gokz-core') 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 + +} diff --git a/source/sourcemod/scripting/gokz-core/misc.sp b/source/sourcemod/scripting/gokz-core/misc.sp index a117880..ae44a1d 100644 --- a/source/sourcemod/scripting/gokz-core/misc.sp +++ b/source/sourcemod/scripting/gokz-core/misc.sp @@ -208,7 +208,7 @@ void OnPlayerRunCmd_Turnbinds(int client, int buttons, int tickcount, float angl void OnPlayerSpawn_PlayerCollision(int client) { // Let players go through other players - SetEntProp(client, Prop_Send, "m_CollisionGroup", GOKZ_COLLISION_GROUP_STANDARD); + // SetEntProp(client, Prop_Send, "m_CollisionGroup", GOKZ_COLLISION_GROUP_STANDARD); } void OnSetModel_PlayerCollision(int client) @@ -230,7 +230,7 @@ void OnSetModel_PlayerCollision(int client) void OnRoundStart_ForceAllTalk() { - gCV_sv_full_alltalk.BoolValue = true; + // gCV_sv_full_alltalk.BoolValue = true; } @@ -350,7 +350,10 @@ void JoinTeam(int client, int newTeam, bool restorePos, bool forceBroadcast = fa // Need to teleport the player to a valid one. float spawnOrigin[3]; float spawnAngles[3]; - GetValidSpawn(spawnOrigin, spawnAngles); + if (newTeam == CS_TEAM_CT) + GetValidSpawnCT(spawnOrigin, spawnAngles); + else + GetValidSpawnT(spawnOrigin, spawnAngles); TeleportPlayer(client, spawnOrigin, spawnAngles); } hasSavedPosition[client] = false; -- cgit v1.2.3