Skip to content

Commit

Permalink
Disabled timer from starting before cookies are loaded.
Browse files Browse the repository at this point in the history
  • Loading branch information
shavitush committed Mar 27, 2019
1 parent 39572ab commit 40d4431
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion addons/sourcemod/scripting/shavit-core.sp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ char gS_LogPath[PLATFORM_MAX_PATH];
char gS_DeleteMap[MAXPLAYERS+1][160];
char gS_WipePlayerID[MAXPLAYERS+1][32];
char gS_Verification[MAXPLAYERS+1][16];
bool gB_CookiesRetrieved[MAXPLAYERS+1];

// flags
int gI_StyleFlag[STYLE_LIMIT];
Expand Down Expand Up @@ -1622,7 +1623,7 @@ int GetTimerStatus(int client)

void StartTimer(int client, int track)
{
if(!IsValidClient(client, true) || GetClientTeam(client) < 2 || IsFakeClient(client))
if(!IsValidClient(client, true) || GetClientTeam(client) < 2 || IsFakeClient(client) || !gB_CookiesRetrieved[client])
{
return;
}
Expand Down Expand Up @@ -1748,6 +1749,8 @@ public void OnClientCookiesCached(int client)
{
CallOnStyleChanged(client, gA_Timers[client].iStyle, style, false);
}

gB_CookiesRetrieved[client] = true;
}

public void OnClientPutInServer(int client)
Expand All @@ -1768,6 +1771,8 @@ public void OnClientPutInServer(int client)
gA_Timers[client].iStyle = 0;
strcopy(gS_DeleteMap[client], 160, "");

gB_CookiesRetrieved[client] = false;

if(AreClientCookiesCached(client))
{
OnClientCookiesCached(client);
Expand Down

0 comments on commit 40d4431

Please sign in to comment.