From 898c46379dc958f743088251369133cfa0f18c54 Mon Sep 17 00:00:00 2001 From: rtldg <55846624+rtldg@users.noreply.github.com> Date: Wed, 20 Jul 2022 15:58:18 +0000 Subject: [PATCH] random things --- .../sourcemod/scripting/include/shavit/core.inc | 2 +- addons/sourcemod/scripting/shavit-core.sp | 16 ++++++++++------ addons/sourcemod/scripting/shavit-sounds.sp | 4 +--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/addons/sourcemod/scripting/include/shavit/core.inc b/addons/sourcemod/scripting/include/shavit/core.inc index ccc4ec5b..41d7c3ee 100644 --- a/addons/sourcemod/scripting/include/shavit/core.inc +++ b/addons/sourcemod/scripting/include/shavit/core.inc @@ -1329,7 +1329,7 @@ native float Shavit_GetMaxVelocity(int client); native void Shavit_SetAvgVelocity(int client, float vel); /** - * Gets the max velocity of a player. + * Sets the max velocity a player has reached in a run. (timer_snapshot_t.fMaxVelocity) * * @param client Client index * @param vel Max velocity diff --git a/addons/sourcemod/scripting/shavit-core.sp b/addons/sourcemod/scripting/shavit-core.sp index 5bf2c9d0..c00e7128 100644 --- a/addons/sourcemod/scripting/shavit-core.sp +++ b/addons/sourcemod/scripting/shavit-core.sp @@ -3549,7 +3549,10 @@ public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float return; } - if (GetStyleSettingBool(gA_Timers[client].bsStyle, "strafe_count_w") + int iGroundEntity = GetEntPropEnt(client, Prop_Send, "m_hGroundEntity"); + + if (iGroundEntity == -1 + && GetStyleSettingBool(gA_Timers[client].bsStyle, "strafe_count_w") && !GetStyleSettingBool(gA_Timers[client].bsStyle, "block_w") && (gA_Timers[client].fLastInputVel[0] <= 0.0) && (vel[0] > 0.0) && GetStyleSettingInt(gA_Timers[client].bsStyle, "force_hsw") != 1 @@ -3558,7 +3561,8 @@ public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float gA_Timers[client].iStrafes++; } - if (GetStyleSettingBool(gA_Timers[client].bsStyle, "strafe_count_s") + if (iGroundEntity == -1 + && GetStyleSettingBool(gA_Timers[client].bsStyle, "strafe_count_s") && !GetStyleSettingBool(gA_Timers[client].bsStyle, "block_s") && (gA_Timers[client].fLastInputVel[0] >= 0.0) && (vel[0] < 0.0) ) @@ -3566,7 +3570,8 @@ public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float gA_Timers[client].iStrafes++; } - if (GetStyleSettingBool(gA_Timers[client].bsStyle, "strafe_count_a") + if (iGroundEntity == -1 + && GetStyleSettingBool(gA_Timers[client].bsStyle, "strafe_count_a") && !GetStyleSettingBool(gA_Timers[client].bsStyle, "block_a") && (gA_Timers[client].fLastInputVel[1] >= 0.0) && (vel[1] < 0.0) && (GetStyleSettingInt(gA_Timers[client].bsStyle, "force_hsw") > 0 || vel[0] == 0.0) @@ -3575,7 +3580,8 @@ public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float gA_Timers[client].iStrafes++; } - if (GetStyleSettingBool(gA_Timers[client].bsStyle, "strafe_count_d") + if (iGroundEntity == -1 + && GetStyleSettingBool(gA_Timers[client].bsStyle, "strafe_count_d") && !GetStyleSettingBool(gA_Timers[client].bsStyle, "block_d") && (gA_Timers[client].fLastInputVel[1] <= 0.0) && (vel[1] > 0.0) && (GetStyleSettingInt(gA_Timers[client].bsStyle, "force_hsw") > 0 || vel[0] == 0.0) @@ -3584,8 +3590,6 @@ public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float gA_Timers[client].iStrafes++; } - int iGroundEntity = GetEntPropEnt(client, Prop_Send, "m_hGroundEntity"); - float fAngle = GetAngleDiff(angles[1], gA_Timers[client].fLastAngle); float fAbsVelocity[3]; diff --git a/addons/sourcemod/scripting/shavit-sounds.sp b/addons/sourcemod/scripting/shavit-sounds.sp index 0079490b..25e99572 100644 --- a/addons/sourcemod/scripting/shavit-sounds.sp +++ b/addons/sourcemod/scripting/shavit-sounds.sp @@ -197,15 +197,13 @@ public void Shavit_OnFinish(int client, int style, float time, int jumps, int st } } -public void Shavit_OnFinish_Post(int client, int style, float time, int jumps, int strafes, float sync, int rank, int overwrite, int track) +public void Shavit_OnFinish_Post(int client, int style, float time, int jumps, int strafes, float sync, int rank, int overwrite, int track, float fOldTime) { if(!gCV_Enabled.BoolValue) { return; } - float fOldTime = Shavit_GetClientPB(client, style, track); - char sSound[PLATFORM_MAX_PATH]; bool bEveryone = false;