mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
Added prespeed setting 2 which also respect shavit_core_nozaxisspeed.
This commit is contained in:
parent
f21ba64c84
commit
203644d1d2
@ -21,7 +21,7 @@
|
||||
// Jumping settings
|
||||
"autobhop" "1" // Enable autobhopping and +ds?
|
||||
"easybhop" "1" // Enable easybhop (disable stamina reset)?
|
||||
"prespeed" "0" // Allow prespeeding regardless of the prespeed server setting?
|
||||
"prespeed" "0" // Allow prespeeding regardless of the prespeed server setting? If set to 2, the value of shavit_core_nozaxisspeed will be respected as well.
|
||||
"velocity_limit" "0.0" // Velocity limit: set to 0.0 for unlimited, 400.00 for 400vel styles etc.
|
||||
"bunnyhopping" "1" // Per-style sv_enablebunnyhopping. Leave as 1 if you want bunnyhopping to maintain player speed. This setting will override _strafe map settings.
|
||||
|
||||
|
||||
@ -135,7 +135,7 @@ enum struct stylesettings_t
|
||||
{
|
||||
bool bAutobhop;
|
||||
bool bEasybhop;
|
||||
bool bPrespeed;
|
||||
int iPrespeed;
|
||||
float fVelocityLimit;
|
||||
bool bEnableBunnyhopping;
|
||||
float fAiraccelerate;
|
||||
|
||||
@ -1708,7 +1708,9 @@ void StartTimer(int client, int track)
|
||||
float fSpeed[3];
|
||||
GetEntPropVector(client, Prop_Data, "m_vecVelocity", fSpeed);
|
||||
|
||||
if(!gCV_NoZAxisSpeed.BoolValue || gA_StyleSettings[gA_Timers[client].iStyle].bPrespeed || (fSpeed[2] == 0.0 && SquareRoot(Pow(fSpeed[0], 2.0) + Pow(fSpeed[1], 2.0)) <= 290.0))
|
||||
if(!gCV_NoZAxisSpeed.BoolValue ||
|
||||
gA_StyleSettings[gA_Timers[client].iStyle].iPrespeed == 1 ||
|
||||
(fSpeed[2] == 0.0 && (gA_StyleSettings[gA_Timers[client].iStyle].iPrespeed == 2 || SquareRoot(Pow(fSpeed[0], 2.0) + Pow(fSpeed[1], 2.0)) <= 290.0)))
|
||||
{
|
||||
Action result = Plugin_Continue;
|
||||
Call_StartForward(gH_Forwards_Start);
|
||||
@ -1960,7 +1962,7 @@ bool LoadStyles()
|
||||
|
||||
gA_StyleSettings[i].bAutobhop = view_as<bool>(kv.GetNum("autobhop", 1));
|
||||
gA_StyleSettings[i].bEasybhop = view_as<bool>(kv.GetNum("easybhop", 1));
|
||||
gA_StyleSettings[i].bPrespeed = view_as<bool>(kv.GetNum("prespeed", 0));
|
||||
gA_StyleSettings[i].iPrespeed = view_as<bool>(kv.GetNum("prespeed", 0));
|
||||
gA_StyleSettings[i].fVelocityLimit = kv.GetFloat("velocity_limit", 0.0);
|
||||
gA_StyleSettings[i].fAiraccelerate = kv.GetFloat("airaccelerate", 1000.0);
|
||||
gA_StyleSettings[i].bEnableBunnyhopping = view_as<bool>(kv.GetNum("bunnyhopping", 1));
|
||||
@ -2641,7 +2643,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
||||
gA_Timers[client].iGroundTicks = 0;
|
||||
}
|
||||
|
||||
if(bInStart && gCV_BlockPreJump.BoolValue && !gA_StyleSettings[gA_Timers[client].iStyle].bPrespeed && (vel[2] > 0 || (buttons & IN_JUMP) > 0))
|
||||
if(bInStart && gCV_BlockPreJump.BoolValue && gA_StyleSettings[gA_Timers[client].iStyle].iPrespeed == 0 && (vel[2] > 0 || (buttons & IN_JUMP) > 0))
|
||||
{
|
||||
vel[2] = 0.0;
|
||||
buttons &= ~IN_JUMP;
|
||||
|
||||
@ -1014,7 +1014,7 @@ public Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float
|
||||
int iGroundEntity = GetEntPropEnt(client, Prop_Send, "m_hGroundEntity");
|
||||
|
||||
// prespeed
|
||||
if(!bNoclip && !gA_StyleSettings[gI_Style[client]].bPrespeed && Shavit_InsideZone(client, Zone_Start, track))
|
||||
if(!bNoclip && gA_StyleSettings[gI_Style[client]].iPrespeed == 0 && Shavit_InsideZone(client, Zone_Start, track))
|
||||
{
|
||||
if((gCV_PreSpeed.IntValue == 2 || gCV_PreSpeed.IntValue == 3) && gI_GroundEntity[client] == -1 && iGroundEntity != -1 && (buttons & IN_JUMP) > 0)
|
||||
{
|
||||
@ -2769,7 +2769,7 @@ public Action Command_Specs(int client, int args)
|
||||
|
||||
public Action Shavit_OnStart(int client)
|
||||
{
|
||||
if(!gA_StyleSettings[gI_Style[client]].bPrespeed && GetEntityMoveType(client) == MOVETYPE_NOCLIP)
|
||||
if(gA_StyleSettings[gI_Style[client]].iPrespeed == 0 && GetEntityMoveType(client) == MOVETYPE_NOCLIP)
|
||||
{
|
||||
return Plugin_Stop;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user