Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
stage 2 bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Riccardo H committed Apr 23, 2019
1 parent 6dd231f commit d7892b7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
14 changes: 14 additions & 0 deletions addons/sourcemod/scripting/SurfTimer.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,9 @@ char g_BlockedChatText[256][256];
// Last time an overlay was displayed
float g_fLastOverlay[MAXPLAYERS + 1];

// Stage 2 Bug Fixer
bool g_wrcpStage2Fix[MAXPLAYERS + 1];

/*---------- Player location restoring ----------*/

// Clients location was restored this run
Expand Down Expand Up @@ -1921,6 +1924,17 @@ public void OnAutoConfigsBuffered()
SetFailState("<Surftimer> %s not found.", szPath2);
}

public void OnClientConnected(int client)
{
g_Stage[g_iClientInZone[client][2]][client] = 1;
g_WrcpStage[client] = 1;
g_Stage[0][client] = 1;
g_bWrcpTimeractivated[client] = false;
g_CurrentStage[client] = 1;
g_VEmax = 1;
g_wrcpStage2Fix[client] = true;
}

public void OnClientPutInServer(int client)
{
if (!IsValidClient(client))
Expand Down
8 changes: 8 additions & 0 deletions addons/sourcemod/scripting/surftimer/buttonpress.sp
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,14 @@ public void CL_OnEndWrcpTimerPress(int client, float time2)
CPrintToChat(client, "%t", "ErrorStageTime", g_szChatPrefix, stage);
return;
}
//Stage 1 to stage 2 glitch stopper.
if(g_wrcpStage2Fix[client] && stage == 2){
g_wrcpStage2Fix[client] = false;
CPrintToChat(client, "Potential S1 to S2 glitch stopped. Stage time was not recorded"); // add to trans. file and add prefix!
return;
}

g_wrcpStage2Fix[client] = false;

char sz_srDiff[128];
float time = g_fFinalWrcpTime[client];
Expand Down
7 changes: 4 additions & 3 deletions addons/sourcemod/scripting/surftimer/hooks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ public Action Event_OnPlayerSpawn(Handle event, const char[] name, bool dontBroa
{
g_WrcpStage[client] = 1;
g_Stage[0][client] = 1;
g_CurrentStage[client] = 1;
g_Stage[g_iClientInZone[client][2]][client] = 1;
g_bWrcpTimeractivated[client] = false;
}

if (g_iCurrentStyle[client] == 4) // 4 low gravity
Expand Down Expand Up @@ -491,9 +494,7 @@ public Action Say_Hook(int client, const char[] command, int argc)
char szStyle[128];
Format(szStyle, sizeof(szStyle), g_szStyleAcronyms[g_iCurrentStyle[client]]);
StringToUpper(szStyle);
Format(szStyle, sizeof(szStyle), "%s-", szStyle);
ReplaceString(szChatRank2, sizeof(szChatRank2), "{style}", szStyle);
Format(szChatRank, sizeof(szChatRank), "%s", szChatRank2);
Format(szChatRank, 154, "[%s] %s", szStyle, szChatRank2);
}
else
ReplaceString(szChatRank, sizeof(szChatRank), "{style}", "");
Expand Down

0 comments on commit d7892b7

Please sign in to comment.