mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
add some checks if shavit-zones is loaded
This commit is contained in:
parent
9902b8adac
commit
fb5c247953
@ -1512,7 +1512,7 @@ void DoJump(int client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TF2 doesn't use stamina
|
// TF2 doesn't use stamina
|
||||||
if (gEV_Type != Engine_TF2 && (GetStyleSettingBool(gA_Timers[client].bsStyle, "easybhop")) || Shavit_InsideZone(client, Zone_Easybhop, gA_Timers[client].iTimerTrack))
|
if (gEV_Type != Engine_TF2 && (GetStyleSettingBool(gA_Timers[client].bsStyle, "easybhop")) || (gB_Zones && Shavit_InsideZone(client, Zone_Easybhop, gA_Timers[client].iTimerTrack)))
|
||||||
{
|
{
|
||||||
SetEntPropFloat(client, Prop_Send, "m_flStamina", 0.0);
|
SetEntPropFloat(client, Prop_Send, "m_flStamina", 0.0);
|
||||||
}
|
}
|
||||||
@ -1692,6 +1692,8 @@ public int Native_CanPause(Handle handler, int numParams)
|
|||||||
iFlags |= CPR_NoTimer;
|
iFlags |= CPR_NoTimer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gB_Zones)
|
||||||
|
{
|
||||||
if (Shavit_InsideZone(client, Zone_Start, gA_Timers[client].iTimerTrack))
|
if (Shavit_InsideZone(client, Zone_Start, gA_Timers[client].iTimerTrack))
|
||||||
{
|
{
|
||||||
iFlags |= CPR_InStartZone;
|
iFlags |= CPR_InStartZone;
|
||||||
@ -1701,6 +1703,7 @@ public int Native_CanPause(Handle handler, int numParams)
|
|||||||
{
|
{
|
||||||
iFlags |= CPR_InEndZone;
|
iFlags |= CPR_InEndZone;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == -1 && GetEntityMoveType(client) != MOVETYPE_LADDER)
|
if(GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == -1 && GetEntityMoveType(client) != MOVETYPE_LADDER)
|
||||||
{
|
{
|
||||||
@ -3088,7 +3091,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
|||||||
}
|
}
|
||||||
|
|
||||||
int iGroundEntity = GetEntPropEnt(client, Prop_Send, "m_hGroundEntity");
|
int iGroundEntity = GetEntPropEnt(client, Prop_Send, "m_hGroundEntity");
|
||||||
bool bInStart = Shavit_InsideZone(client, Zone_Start, gA_Timers[client].iTimerTrack);
|
bool bInStart = gB_Zones && Shavit_InsideZone(client, Zone_Start, gA_Timers[client].iTimerTrack);
|
||||||
|
|
||||||
if (gA_Timers[client].bTimerEnabled && !gA_Timers[client].bClientPaused)
|
if (gA_Timers[client].bTimerEnabled && !gA_Timers[client].bClientPaused)
|
||||||
{
|
{
|
||||||
@ -3154,7 +3157,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
|||||||
}
|
}
|
||||||
|
|
||||||
// key blocking
|
// key blocking
|
||||||
if(!gA_Timers[client].bCanUseAllKeys && mtMoveType != MOVETYPE_NOCLIP && mtMoveType != MOVETYPE_LADDER && !Shavit_InsideZone(client, Zone_Freestyle, -1))
|
if(!gA_Timers[client].bCanUseAllKeys && mtMoveType != MOVETYPE_NOCLIP && mtMoveType != MOVETYPE_LADDER && !(gB_Zones && Shavit_InsideZone(client, Zone_Freestyle, -1)))
|
||||||
{
|
{
|
||||||
// block E
|
// block E
|
||||||
if (GetStyleSettingBool(gA_Timers[client].bsStyle, "block_use") && (buttons & IN_USE) > 0)
|
if (GetStyleSettingBool(gA_Timers[client].bsStyle, "block_use") && (buttons & IN_USE) > 0)
|
||||||
|
|||||||
@ -1386,7 +1386,7 @@ int AddHUDToBuffer_Source2013(int client, huddata_t data, char[] buffer, int max
|
|||||||
|
|
||||||
float limit = Shavit_GetStyleSettingFloat(data.iStyle, "velocity_limit");
|
float limit = Shavit_GetStyleSettingFloat(data.iStyle, "velocity_limit");
|
||||||
|
|
||||||
if (limit > 0.0 && Shavit_InsideZone(data.iTarget, Zone_CustomSpeedLimit, data.iTrack))
|
if (limit > 0.0 && gB_Zones && Shavit_InsideZone(data.iTarget, Zone_CustomSpeedLimit, data.iTrack))
|
||||||
{
|
{
|
||||||
if(gI_ZoneSpeedLimit[data.iTarget] == 0)
|
if(gI_ZoneSpeedLimit[data.iTarget] == 0)
|
||||||
{
|
{
|
||||||
@ -1676,6 +1676,8 @@ void UpdateMainHUD(int client)
|
|||||||
huddata.iTrack = (bReplay) ? Shavit_GetReplayBotTrack(target) : Shavit_GetClientTrack(target);
|
huddata.iTrack = (bReplay) ? Shavit_GetReplayBotTrack(target) : Shavit_GetClientTrack(target);
|
||||||
|
|
||||||
if(!bReplay)
|
if(!bReplay)
|
||||||
|
{
|
||||||
|
if (gB_Zones)
|
||||||
{
|
{
|
||||||
if (Shavit_InsideZone(target, Zone_Start, huddata.iTrack))
|
if (Shavit_InsideZone(target, Zone_Start, huddata.iTrack))
|
||||||
{
|
{
|
||||||
@ -1686,6 +1688,7 @@ void UpdateMainHUD(int client)
|
|||||||
iZoneHUD = ZoneHUD_End;
|
iZoneHUD = ZoneHUD_End;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (huddata.iStyle != -1)
|
if (huddata.iStyle != -1)
|
||||||
|
|||||||
@ -134,6 +134,7 @@ bool gB_Eventqueuefix = false;
|
|||||||
bool gB_Rankings = false;
|
bool gB_Rankings = false;
|
||||||
bool gB_ReplayPlayback = false;
|
bool gB_ReplayPlayback = false;
|
||||||
bool gB_Chat = false;
|
bool gB_Chat = false;
|
||||||
|
bool gB_Zones = false;
|
||||||
|
|
||||||
// timer settings
|
// timer settings
|
||||||
stylestrings_t gS_StyleStrings[STYLE_LIMIT];
|
stylestrings_t gS_StyleStrings[STYLE_LIMIT];
|
||||||
@ -302,6 +303,7 @@ public void OnPluginStart()
|
|||||||
gB_Rankings = LibraryExists("shavit-rankings");
|
gB_Rankings = LibraryExists("shavit-rankings");
|
||||||
gB_ReplayPlayback = LibraryExists("shavit-replay-playback");
|
gB_ReplayPlayback = LibraryExists("shavit-replay-playback");
|
||||||
gB_Chat = LibraryExists("shavit-chat");
|
gB_Chat = LibraryExists("shavit-chat");
|
||||||
|
gB_Zones = LibraryExists("shavit-zones");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnAllPluginsLoaded()
|
public void OnAllPluginsLoaded()
|
||||||
@ -646,6 +648,10 @@ public void OnLibraryAdded(const char[] name)
|
|||||||
{
|
{
|
||||||
gB_Chat = true;
|
gB_Chat = true;
|
||||||
}
|
}
|
||||||
|
else if (StrEqual(name, "shavit-zones"))
|
||||||
|
{
|
||||||
|
gB_Zones = true;
|
||||||
|
}
|
||||||
else if (StrEqual(name, "shavit-checkpoints"))
|
else if (StrEqual(name, "shavit-checkpoints"))
|
||||||
{
|
{
|
||||||
gB_Checkpoints = true;
|
gB_Checkpoints = true;
|
||||||
@ -670,6 +676,10 @@ public void OnLibraryRemoved(const char[] name)
|
|||||||
{
|
{
|
||||||
gB_Chat = false;
|
gB_Chat = false;
|
||||||
}
|
}
|
||||||
|
else if (StrEqual(name, "shavit-zones"))
|
||||||
|
{
|
||||||
|
gB_Zones = false;
|
||||||
|
}
|
||||||
else if (StrEqual(name, "shavit-checkpoints"))
|
else if (StrEqual(name, "shavit-checkpoints"))
|
||||||
{
|
{
|
||||||
gB_Checkpoints = false;
|
gB_Checkpoints = false;
|
||||||
@ -1189,7 +1199,7 @@ void DumbSetVelocity(int client, float fSpeed[3])
|
|||||||
public Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float vel[3], float angles[3], TimerStatus status, int track, int style)
|
public Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float vel[3], float angles[3], TimerStatus status, int track, int style)
|
||||||
{
|
{
|
||||||
bool bNoclip = (GetEntityMoveType(client) == MOVETYPE_NOCLIP);
|
bool bNoclip = (GetEntityMoveType(client) == MOVETYPE_NOCLIP);
|
||||||
bool bInStart = Shavit_InsideZone(client, Zone_Start, track);
|
bool bInStart = gB_Zones && Shavit_InsideZone(client, Zone_Start, track);
|
||||||
|
|
||||||
// i will not be adding a setting to toggle this off
|
// i will not be adding a setting to toggle this off
|
||||||
if(bNoclip)
|
if(bNoclip)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user