#define TIME_TO_TICKS( dt ) ( ( int )( 0.5f + ( float )( dt ) / I::Globals->interval_per_tick ) )
float LagFix()
{
float updaterate = I::Cvar->FindVar("cl_updaterate")->fValue;
ConVar* minupdate = I::Cvar->FindVar("sv_minupdaterate");
ConVar* maxupdate = I::Cvar->FindVar("sv_maxupdaterate");
if (minupdate && maxupdate)
updaterate = maxupdate->fValue;
float ratio = I::Cvar->FindVar("cl_interp_ratio")->fValue;
if (ratio == 0)
ratio = 1.0f;
float lerp = I::Cvar->FindVar("cl_interp")->fValue;
ConVar* cmin = I::Cvar->FindVar("sv_client_min_interp_ratio");
ConVar* cmax = I::Cvar->FindVar("sv_client_max_interp_ratio");
if (cmin && cmax && cmin->fValue != 1)
ratio = U::Clamp(ratio, cmin->fValue, cmax->fValue);
return max(lerp, ratio / updaterate);
}