like amiri in my mind
Пользователь
-
Автор темы
- #1
creds Breaker big pasta , just converted from: https://yougame.biz/threads/281102/
Код:
if (previous_record)
{
upd_delay = TIME_TO_TICKS(e->m_flSimulationTime() - previous_record->simulation_time);
math::clamp(upd_delay, 1, 17);
e->m_vecVelocity() = (e->m_vecOrigin() - previous_record->origin) / TICKS_TO_TIME(upd_delay);
if (record->flags & FL_ONGROUND) {
if (record->layers[6].m_flWeight == 0.0f)
e->m_vecVelocity().Zero();
else {
float velocity = e->m_vecVelocity().Length2D() / e->GetMaxPlayerSpeed();
float delta = velocity - record->layers[6].m_flWeight;
e->m_vecVelocity() *= (1.f - delta);
e->m_vecVelocity().z = 0.f;
}
}
else
e->m_vecVelocity().z -= m_cvar()->FindVar(crypt_str("sv_gravity"))->GetFloat() * TICKS_TO_TIME(upd_delay) * 0.5f;
}