Fixed 'shavit_hud_ticksperupdate'.

This commit is contained in:
shavit 2018-01-26 19:50:16 +02:00
parent 9a49977e10
commit 5ba897e274

View File

@ -46,7 +46,6 @@ int gI_Cycle = 0;
int gI_GradientColors[3];
int gI_GradientDirection = -1;
int gI_Styles = 0;
int gI_Tickrate = 0;
Handle gH_HUDCookie = null;
int gI_HUDSettings[MAXPLAYERS+1];
@ -104,7 +103,6 @@ public void OnPluginStart()
// game-specific
gEV_Type = GetEngineVersion();
gI_Tickrate = RoundToZero(1.0 / GetTickInterval());
if(IsSource2013(gEV_Type))
{
@ -134,7 +132,7 @@ public void OnPluginStart()
// plugin convars
gCV_GradientStepSize = CreateConVar("shavit_hud_gradientstepsize", "15", "How fast should the start/end HUD gradient be?\nThe number is the amount of color change per 0.1 seconds.\nThe higher the number the faster the gradient.", 0, true, 1.0, true, 255.0);
gCV_TicksPerUpdate = CreateConVar("shavit_hud_ticksperupdate", "20", "How often (in ticks) should the HUD update?\nPlay around with this value until you find the best for your server.\nThe maximum value is your tickrate.", 0, true, 1.0, true, float(gI_Tickrate));
gCV_TicksPerUpdate = CreateConVar("shavit_hud_ticksperupdate", "20", "How often (in ticks) should the HUD update?\nPlay around with this value until you find the best for your server.\nThe maximum value is your tickrate.", 0, true, 1.0, true, (1.0 / GetTickInterval()));
gCV_GradientStepSize.AddChangeHook(OnConVarChanged);
gCV_TicksPerUpdate.AddChangeHook(OnConVarChanged);
@ -483,7 +481,7 @@ public int MenuHandler_HUD(Menu menu, MenuAction action, int param1, int param2)
public void OnGameFrame()
{
if(GetGameTickCount() % (gI_Tickrate / gI_TicksPerUpdate) == 0)
if(GetGameTickCount() % gI_TicksPerUpdate == 0)
{
Cron();
}