retard
-
Автор темы
- #1
C++:
template<class T, class U>
T fine(T in, U low, U high)
{
if (in <= low)
return low;
if (in >= high)
return high;
return in;
}
void LagCompensation::LinearExtrapolations()
{
if (g_menu.main.aimbot.lagfix.get())
{
auto m_local = g_cl.m_local;
if (m_local && m_local->alive()) {
for (int i = 1; i < g_csgo.m_globals->m_max_clients; i++)
{
auto m_entity = g_csgo.m_entlist->GetClientEntity(i);
if (m_entity && m_entity->is_valid(m_local)) {
float simtime_delta = m_entity->m_flSimulationTime() - m_entity->m_flOldSimulationTime();
int choked_ticks = fine(game::TIME_TO_TICKS(simtime_delta), 1, 15);
vec3_t lastOrig;
if (lastOrig.length() != m_entity->m_vecOrigin().length())
lastOrig = m_entity->m_vecOrigin();
float delta_distance = (m_entity->m_vecOrigin() - lastOrig).length_sqr();
if (delta_distance > 4096.f)
{
vec3_t velocity_per_tick = m_entity->m_vecVelocity() * g_csgo.m_globals->m_interval;
auto new_origin = m_entity->m_vecOrigin() + (velocity_per_tick * choked_ticks);
m_entity->SetAbsOrigin(new_origin);
}
}
}
}
}
}