Skip to content

Commit

Permalink
use style runspeed instead of m_flMaxspeed for tas (and autoprestrafe)
Browse files Browse the repository at this point in the history
(autoprestrafe is broken on 250 runspeed otherwise...)
  • Loading branch information
rtldg committed Jun 2, 2024
1 parent 44ac27a commit 3609adf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions addons/sourcemod/scripting/include/shavit/tas-oblivious.inc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ stock float ground_delta_opt(int client, float angles[3], float move[3], float s

wishspeed = GetVectorLength(wishvel);

if(wishspeed > GetEntPropFloat(client, Prop_Send, "m_flMaxspeed") && GetEntPropFloat(client, Prop_Send, "m_flMaxspeed") != 0.0) wishspeed = GetEntPropFloat(client, Prop_Send, "m_flMaxspeed");
float flMaxSpeed = Shavit_GetStyleSettingFloat(Shavit_GetBhopStyle(client), "runspeed");
if(wishspeed > flMaxSpeed && flMaxSpeed != 0.0) wishspeed = flMaxSpeed;

float velocity[3];
GetEntPropVector(client, Prop_Data, "m_vecVelocity", velocity);
Expand Down Expand Up @@ -106,7 +107,7 @@ stock Action ObliviousOnPlayerRunCmd(int client, int& buttons, int& impulse, flo
float air_accelerate, float surface_friction, float flAirSpeedCap, float flMaxMove,
bool no_speed_loss)
{
float flMaxSpeed = GetEntPropFloat(client, Prop_Send, "m_flMaxspeed");
float flMaxSpeed = Shavit_GetStyleSettingFloat(Shavit_GetBhopStyle(client), "runspeed");

bool set_back = true;
if (vel[0] != 0.0 || vel[1] != 0.0)
Expand Down
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/include/shavit/tas-xutax.inc
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ stock Action XutaxOnPlayerRunCmd(int client, int& buttons, int& impulse, float v
vel[0] = 0.0;

float flFowardMove, flSideMove;
float flMaxSpeed = GetEntPropFloat(client, Prop_Data, "m_flMaxspeed");
float flMaxSpeed = Shavit_GetStyleSettingFloat(Shavit_GetBhopStyle(client), "runspeed");
float flVelocity[3], flVelocity2D[2];

GetEntPropVector(client, Prop_Data, "m_vecVelocity", flVelocity);
Expand Down

0 comments on commit 3609adf

Please sign in to comment.