From 8be2d1085cd035865bc610981f72bbadcb9f14d6 Mon Sep 17 00:00:00 2001 From: shavit Date: Mon, 7 May 2018 18:25:01 +0300 Subject: [PATCH] Adjusted replays to record when the timer is running. --- addons/sourcemod/scripting/shavit-replay.sp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/addons/sourcemod/scripting/shavit-replay.sp b/addons/sourcemod/scripting/shavit-replay.sp index e0198215..ef4867cb 100644 --- a/addons/sourcemod/scripting/shavit-replay.sp +++ b/addons/sourcemod/scripting/shavit-replay.sp @@ -85,7 +85,6 @@ bool gB_ForciblyStopped = false; bool gB_Button[MAXPLAYERS+1]; int gI_PlayerFrames[MAXPLAYERS+1]; ArrayList gA_PlayerFrames[MAXPLAYERS+1]; -bool gB_Record[MAXPLAYERS+1]; int gI_Track[MAXPLAYERS+1]; bool gB_Late = false; @@ -442,11 +441,6 @@ public int Native_SetReplayData(Handle handler, int numParams) delete frames; gI_PlayerFrames[client] = gA_PlayerFrames[client].Length; - - if(gI_PlayerFrames[client] > 0) - { - gB_Record[client] = true; - } } public int Native_GetReplayData(Handle handler, int numParams) @@ -1325,7 +1319,6 @@ public void OnClientDisconnect(int client) public Action Shavit_OnStart(int client) { ClearFrames(client); - gB_Record[client] = true; return Plugin_Continue; } @@ -1349,8 +1342,6 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st return; } - gB_Record[client] = false; - bool newformat = view_as(gA_FrameCache[style][track][2]); float length = GetReplayLength(style, track); @@ -1425,16 +1416,6 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st ClearFrames(client); } -public void Shavit_OnPause(int client) -{ - gB_Record[client] = false; -} - -public void Shavit_OnResume(int client) -{ - gB_Record[client] = true; -} - void ApplyFlags(int &flags1, int flags2, int flag) { if((flags2 & flag) > 0) @@ -1619,7 +1600,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 } } - else if(gB_Record[client] && ReplayEnabled(Shavit_GetBhopStyle(client)) && Shavit_GetTimerStatus(client) == Timer_Running) + else if(Shavit_GetTimerStatus(client) == Timer_Running && ReplayEnabled(Shavit_GetBhopStyle(client)) && Shavit_GetTimerStatus(client) == Timer_Running) { gA_PlayerFrames[client].Resize(gI_PlayerFrames[client] + 1);