fix typos for avg/max velocity

This commit is contained in:
Joe 2021-02-26 02:46:08 +00:00
parent d4893ec713
commit 07e07fd7c8
2 changed files with 5 additions and 5 deletions

View File

@ -1842,7 +1842,7 @@ native void Shavit_LogMessage(const char[] format, any ...);
/** /**
* Gets the average and max velocity of a player's jumps. * Gets the average and max velocity of a player's jumps.
* Velocity is calculated as a 2d vector (GetVectorLength(fSpeed)). * Velocity is calculated as a 2d vector.
* Average calculation: avg += (vel - avg) / jumps * Average calculation: avg += (vel - avg) / jumps
* *
* @param client Client index * @param client Client index

View File

@ -1440,9 +1440,9 @@ void VelocityChanges(int data)
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fAbsVelocity); TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fAbsVelocity);
} }
if (GetTimerStatus(client) == Timer_Running) if (GetTimerStatus(client) == view_as<int>(Timer_Running))
{ {
float curVel = GetVectorLength(fAbsVelocity); float curVel = SquareRoot(Pow(fAbsVelocity[0], 2.0) + Pow(fAbsVelocity[1], 2.0));
float maxVel = gA_Timers[client].fMaxVelocity; float maxVel = gA_Timers[client].fMaxVelocity;
gA_Timers[client].fMaxVelocity = (curVel > maxVel) ? curVel : maxVel; gA_Timers[client].fMaxVelocity = (curVel > maxVel) ? curVel : maxVel;
// STOLEN from Epic/Disrevoid. Thx :) // STOLEN from Epic/Disrevoid. Thx :)
@ -2179,8 +2179,8 @@ public any Native_HasStyleSetting(Handle handler, int numParams)
public any Native_GetAvgMaxVelocity(Handle plugin, int numParams) public any Native_GetAvgMaxVelocity(Handle plugin, int numParams)
{ {
int client = GetNativeCell(1); int client = GetNativeCell(1);
SetNativeCellRef(2, gF_AvgVelocity[client]); SetNativeCellRef(2, gA_Timers[client].fAvgVelocity);
SetNativeCellRef(3, gF_MaxVelocity[client]); SetNativeCellRef(3, gA_Timers[client].fMaxVelocity);
} }
bool HasStyleSetting(int style, char[] key) bool HasStyleSetting(int style, char[] key)