Начинающий
-
Автор темы
- #1
Код:
if (previous) {
if (lag > 0) {
e->m_vecVelocity() = (current->origin - previous->origin) / TICKS_TO_TIME(lag);
}
else
e->m_vecVelocity() = previous->velocity;
if (current->flags & FL_ONGROUND) {
if (current->layers[6].m_flWeight == 0.0f)
e->m_vecVelocity().Zero();
float velocity = e->m_vecVelocity().Length2D() / e->GetMaxPlayerSpeed();
float delta = velocity - current->layers[6].m_flWeight;
e->m_vecVelocity() *= (1.f - delta);
e->m_vecVelocity().z = 0.f;
}
}