diff --git a/addons/sourcemod/scripting/shavit-core.sp b/addons/sourcemod/scripting/shavit-core.sp index 7b2e8247..0f86ce90 100644 --- a/addons/sourcemod/scripting/shavit-core.sp +++ b/addons/sourcemod/scripting/shavit-core.sp @@ -1174,6 +1174,8 @@ public int Native_LoadSnapshot(Handle handler, int numParams) any[] snapshot = new any[TIMERSNAPSHOT_SIZE]; GetNativeArray(2, snapshot, TIMERSNAPSHOT_SIZE); + gI_Track[client] = view_as(snapshot[iTimerTrack]); + if(gBS_Style[client] != snapshot[bsStyle]) { CallOnStyleChanged(client, gBS_Style[client], snapshot[bsStyle], false); @@ -1189,8 +1191,7 @@ public int Native_LoadSnapshot(Handle handler, int numParams) gI_TotalMeasures[client] = view_as(snapshot[iTotalMeasures]); gI_GoodGains[client] = view_as(snapshot[iGoodGains]); gF_StartTime[client] = GetEngineTime() - view_as(snapshot[fCurrentTime]); - gI_SHSW_FirstCombination[client] = view_as(snapshot[iSHSWCombination]); - gI_Track[client] = view_as(snapshot[iTimerTrack]); + gI_SHSW_FirstCombination[client] = view_as(snapshot[iSHSWCombination]);\ } public int Native_MarkKZMap(Handle handler, int numParams) @@ -1228,7 +1229,7 @@ void StartTimer(int client, int track) float fSpeed[3]; GetEntPropVector(client, Prop_Data, "m_vecVelocity", fSpeed); - if(!gB_NoZAxisSpeed || gA_StyleSettings[gBS_Style[client]][bPrespeed] || fSpeed[2] == 0.0 || SquareRoot(Pow(fSpeed[0], 2.0) + Pow(fSpeed[1], 2.0)) <= 280.0) + if(!gB_NoZAxisSpeed || gA_StyleSettings[gBS_Style[client]][bPrespeed] || (fSpeed[2] == 0.0 && SquareRoot(Pow(fSpeed[0], 2.0) + Pow(fSpeed[1], 2.0)) <= 280.0)) { gI_Strafes[client] = 0; gI_Jumps[client] = 0; @@ -1247,6 +1248,13 @@ void StartTimer(int client, int track) { gB_TimerEnabled[client] = true; gI_SHSW_FirstCombination[client] = -1; + + gF_PauseTotalTime[client] = 0.0; + gB_ClientPaused[client] = false; + gB_PracticeMode[client] = false; + + SetEntityGravity(client, view_as(gA_StyleSettings[gBS_Style[client]][fGravityMultiplier])); + SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", view_as(gA_StyleSettings[gBS_Style[client]][fSpeedMultiplier])); } else if(result == Plugin_Handled || result == Plugin_Stop) @@ -1254,13 +1262,6 @@ void StartTimer(int client, int track) gB_TimerEnabled[client] = false; } } - - gF_PauseTotalTime[client] = 0.0; - gB_ClientPaused[client] = false; - gB_PracticeMode[client] = false; - - SetEntityGravity(client, view_as(gA_StyleSettings[gBS_Style[client]][fGravityMultiplier])); - SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", view_as(gA_StyleSettings[gBS_Style[client]][fSpeedMultiplier])); } void StopTimer(int client) diff --git a/addons/sourcemod/scripting/shavit-misc.sp b/addons/sourcemod/scripting/shavit-misc.sp index 34b90682..3bdc321e 100644 --- a/addons/sourcemod/scripting/shavit-misc.sp +++ b/addons/sourcemod/scripting/shavit-misc.sp @@ -1641,6 +1641,11 @@ void TeleportToCheckpoint(int client, int index, bool suppressMessage) bool bInStart = Shavit_InsideZone(client, Zone_Start, -1); + if(bInStart) + { + Shavit_StopTimer(client); + } + Shavit_SetPracticeMode(client, true, !bInStart); Shavit_LoadSnapshot(client, gA_CheckpointsSnapshots[client][index]); @@ -1653,11 +1658,6 @@ void TeleportToCheckpoint(int client, int index, bool suppressMessage) SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", view_as(gA_PlayerCheckPointsCache[client][index][fCPSpeed])); SetEntPropFloat(client, Prop_Send, "m_flStamina", view_as(gA_PlayerCheckPointsCache[client][index][fCPStamina])); DispatchKeyValue(client, "targetname", gS_CheckpointsTargetname[client][index]); - - if(bInStart) - { - Shavit_StopTimer(client); - } if(!suppressMessage) {