mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 18:38:26 +00:00
Removed some core cvars where style settings exist.
shavit_core_autobhop shavit_core_blockleftright shavit_core_nostaminareset Use the appropriate style settings for them instead.
This commit is contained in:
parent
a01bbefe39
commit
6059b19cb2
@ -94,22 +94,16 @@ bool gB_Zones = false;
|
||||
bool gB_WR = false;
|
||||
|
||||
// cvars
|
||||
ConVar gCV_Autobhop = null;
|
||||
ConVar gCV_LeftRight = null;
|
||||
ConVar gCV_Restart = null;
|
||||
ConVar gCV_Pause = null;
|
||||
ConVar gCV_NoStaminaReset = null;
|
||||
ConVar gCV_AllowTimerWithoutZone = null;
|
||||
ConVar gCV_BlockPreJump = null;
|
||||
ConVar gCV_NoZAxisSpeed = null;
|
||||
ConVar gCV_VelocityTeleport = null;
|
||||
|
||||
// cached cvars
|
||||
bool gB_Autobhop = true;
|
||||
bool gB_LeftRight = true;
|
||||
bool gB_Restart = true;
|
||||
bool gB_Pause = true;
|
||||
bool gB_NoStaminaReset = true;
|
||||
bool gB_AllowTimerWithoutZone = false;
|
||||
bool gB_BlockPreJump = false;
|
||||
bool gB_NoZAxisSpeed = true;
|
||||
@ -290,21 +284,15 @@ public void OnPluginStart()
|
||||
|
||||
CreateConVar("shavit_version", SHAVIT_VERSION, "Plugin version.", (FCVAR_NOTIFY | FCVAR_DONTRECORD));
|
||||
|
||||
gCV_Autobhop = CreateConVar("shavit_core_autobhop", "1", "Enable autobhop?\nWill be forced to not work if STYLE_AUTOBHOP is not defined for a style!", FCVAR_NOTIFY, true, 0.0, true, 1.0);
|
||||
gCV_LeftRight = CreateConVar("shavit_core_blockleftright", "1", "Block +left/right?", 0, true, 0.0, true, 1.0);
|
||||
gCV_Restart = CreateConVar("shavit_core_restart", "1", "Allow commands that restart the timer?", 0, true, 0.0, true, 1.0);
|
||||
gCV_Pause = CreateConVar("shavit_core_pause", "1", "Allow pausing?", 0, true, 0.0, true, 1.0);
|
||||
gCV_NoStaminaReset = CreateConVar("shavit_core_nostaminareset", "1", "Disables the built-in stamina reset.\nAlso known as 'easybhop'.\nWill be forced to not work if STYLE_EASYBHOP is not defined for a style!", 0, true, 0.0, true, 1.0);
|
||||
gCV_AllowTimerWithoutZone = CreateConVar("shavit_core_timernozone", "0", "Allow the timer to start if there's no start zone?", 0, true, 0.0, true, 1.0);
|
||||
gCV_BlockPreJump = CreateConVar("shavit_core_blockprejump", "0", "Prevents jumping in the start zone.", 0, true, 0.0, true, 1.0);
|
||||
gCV_NoZAxisSpeed = CreateConVar("shavit_core_nozaxisspeed", "1", "Don't start timer if vertical speed exists (btimes style).", 0, true, 0.0, true, 1.0);
|
||||
gCV_VelocityTeleport = CreateConVar("shavit_core_velocityteleport", "0", "Teleport the client when changing its velocity? (for special styles)", 0, true, 0.0, true, 1.0);
|
||||
|
||||
gCV_Autobhop.AddChangeHook(OnConVarChanged);
|
||||
gCV_LeftRight.AddChangeHook(OnConVarChanged);
|
||||
gCV_Restart.AddChangeHook(OnConVarChanged);
|
||||
gCV_Pause.AddChangeHook(OnConVarChanged);
|
||||
gCV_NoStaminaReset.AddChangeHook(OnConVarChanged);
|
||||
gCV_AllowTimerWithoutZone.AddChangeHook(OnConVarChanged);
|
||||
gCV_BlockPreJump.AddChangeHook(OnConVarChanged);
|
||||
gCV_NoZAxisSpeed.AddChangeHook(OnConVarChanged);
|
||||
@ -342,11 +330,8 @@ public void OnPluginStart()
|
||||
|
||||
public void OnConVarChanged(ConVar convar, const char[] oldValue, const char[] newValue)
|
||||
{
|
||||
gB_Autobhop = gCV_Autobhop.BoolValue;
|
||||
gB_LeftRight = gCV_LeftRight.BoolValue;
|
||||
gB_Restart = gCV_Restart.BoolValue;
|
||||
gB_Pause = gCV_Pause.BoolValue;
|
||||
gB_NoStaminaReset = gCV_NoStaminaReset.BoolValue;
|
||||
gB_AllowTimerWithoutZone = gCV_AllowTimerWithoutZone.BoolValue;
|
||||
gB_BlockPreJump = gCV_BlockPreJump.BoolValue;
|
||||
gB_NoZAxisSpeed = gCV_NoZAxisSpeed.BoolValue;
|
||||
@ -801,7 +786,7 @@ void DoJump(int client)
|
||||
}
|
||||
|
||||
// TF2 doesn't use stamina
|
||||
if(gEV_Type != Engine_TF2 && (gB_NoStaminaReset && gA_StyleSettings[gBS_Style[client]][bEasybhop]) || Shavit_InsideZone(client, Zone_Easybhop, gI_Track[client]))
|
||||
if(gEV_Type != Engine_TF2 && (gA_StyleSettings[gBS_Style[client]][bEasybhop]) || Shavit_InsideZone(client, Zone_Easybhop, gI_Track[client]))
|
||||
{
|
||||
SetEntPropFloat(client, Prop_Send, "m_flStamina", 0.0);
|
||||
}
|
||||
@ -1863,7 +1848,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
||||
char[] sCheatDetected = new char[64];
|
||||
|
||||
// +left/right block
|
||||
if(gB_LeftRight && (!gB_Zones || !bInStart && ((gA_StyleSettings[gBS_Style[client]][bBlockPLeft] &&
|
||||
if(!gB_Zones || (!bInStart && ((gA_StyleSettings[gBS_Style[client]][bBlockPLeft] &&
|
||||
(buttons & IN_LEFT) > 0) || (gA_StyleSettings[gBS_Style[client]][bBlockPRight] && (buttons & IN_RIGHT) > 0))))
|
||||
{
|
||||
FormatEx(sCheatDetected, 64, "%T", "LeftRightCheat", client);
|
||||
@ -2056,7 +2041,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
||||
SetEntPropVector(client, Prop_Data, "m_vecAbsVelocity", fSpeed);
|
||||
}
|
||||
|
||||
if(gA_StyleSettings[gBS_Style[client]][bAutobhop] && gB_Autobhop && gB_Auto[client] && (buttons & IN_JUMP) > 0 && mtMoveType == MOVETYPE_WALK && !bInWater)
|
||||
if(gA_StyleSettings[gBS_Style[client]][bAutobhop] && gB_Auto[client] && (buttons & IN_JUMP) > 0 && mtMoveType == MOVETYPE_WALK && !bInWater)
|
||||
{
|
||||
int iOldButtons = GetEntProp(client, Prop_Data, "m_nOldButtons");
|
||||
SetEntProp(client, Prop_Data, "m_nOldButtons", iOldButtons & ~IN_JUMP);
|
||||
@ -2168,7 +2153,7 @@ void UpdateAutoBhop(int client)
|
||||
{
|
||||
if(sv_autobunnyhopping != null)
|
||||
{
|
||||
sv_autobunnyhopping.ReplicateToClient(client, (gA_StyleSettings[gBS_Style[client]][bAutobhop] && gB_Autobhop && gB_Auto[client])? "1":"0");
|
||||
sv_autobunnyhopping.ReplicateToClient(client, (gA_StyleSettings[gBS_Style[client]][bAutobhop] && gB_Auto[client])? "1":"0");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user