mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-29 08:05:46 +03:00
Adjust gib's velocity limit according to sv_maxvelocity (#846)
* Adjust gib's velocity limit according to sv_maxvelocity * Gib max velocity adjusted to sv_maxvelocity
This commit is contained in:
parent
11d6b086b4
commit
8a8f348755
@ -5,13 +5,14 @@ LINK_ENTITY_TO_CLASS(gib, CGib, CCSGib)
|
|||||||
void CGib::LimitVelocity()
|
void CGib::LimitVelocity()
|
||||||
{
|
{
|
||||||
float length = pev->velocity.Length();
|
float length = pev->velocity.Length();
|
||||||
|
float topspeed = CVAR_GET_FLOAT("sv_maxvelocity") * 0.75f;
|
||||||
|
|
||||||
// ceiling at 1500. The gib velocity equation is not bounded properly. Rather than tune it
|
// ceiling at topspeed. The gib velocity equation is not bounded properly. Rather than tune it
|
||||||
// in 3 separate places again, I'll just limit it here.
|
// in 3 separate places again, I'll just limit it here.
|
||||||
if (length > 1500.0)
|
if (length > topspeed)
|
||||||
{
|
{
|
||||||
// This should really be sv_maxvelocity * 0.75 or something
|
// DONE: This should really be sv_maxvelocity * 0.75 or something
|
||||||
pev->velocity = pev->velocity.Normalize() * 1500;
|
pev->velocity = pev->velocity.Normalize() * topspeed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user