Adjusted replays to record when the timer is running.

This commit is contained in:
shavit 2018-05-07 18:25:01 +03:00
parent a0c13d466c
commit 8be2d1085c

View File

@ -85,7 +85,6 @@ bool gB_ForciblyStopped = false;
bool gB_Button[MAXPLAYERS+1]; bool gB_Button[MAXPLAYERS+1];
int gI_PlayerFrames[MAXPLAYERS+1]; int gI_PlayerFrames[MAXPLAYERS+1];
ArrayList gA_PlayerFrames[MAXPLAYERS+1]; ArrayList gA_PlayerFrames[MAXPLAYERS+1];
bool gB_Record[MAXPLAYERS+1];
int gI_Track[MAXPLAYERS+1]; int gI_Track[MAXPLAYERS+1];
bool gB_Late = false; bool gB_Late = false;
@ -442,11 +441,6 @@ public int Native_SetReplayData(Handle handler, int numParams)
delete frames; delete frames;
gI_PlayerFrames[client] = gA_PlayerFrames[client].Length; gI_PlayerFrames[client] = gA_PlayerFrames[client].Length;
if(gI_PlayerFrames[client] > 0)
{
gB_Record[client] = true;
}
} }
public int Native_GetReplayData(Handle handler, int numParams) public int Native_GetReplayData(Handle handler, int numParams)
@ -1325,7 +1319,6 @@ public void OnClientDisconnect(int client)
public Action Shavit_OnStart(int client) public Action Shavit_OnStart(int client)
{ {
ClearFrames(client); ClearFrames(client);
gB_Record[client] = true;
return Plugin_Continue; return Plugin_Continue;
} }
@ -1349,8 +1342,6 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st
return; return;
} }
gB_Record[client] = false;
bool newformat = view_as<bool>(gA_FrameCache[style][track][2]); bool newformat = view_as<bool>(gA_FrameCache[style][track][2]);
float length = GetReplayLength(style, track); 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); 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) void ApplyFlags(int &flags1, int flags2, int flag)
{ {
if((flags2 & flag) > 0) 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); gA_PlayerFrames[client].Resize(gI_PlayerFrames[client] + 1);