From 8a8f3487555497b966d078459606a7efb387c0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mu=C3=B1oz?= Date: Fri, 14 Jul 2023 17:34:54 -0400 Subject: [PATCH] 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 --- regamedll/dlls/gib.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/regamedll/dlls/gib.cpp b/regamedll/dlls/gib.cpp index 5b9122d04..069b118d9 100644 --- a/regamedll/dlls/gib.cpp +++ b/regamedll/dlls/gib.cpp @@ -5,13 +5,14 @@ LINK_ENTITY_TO_CLASS(gib, CGib, CCSGib) void CGib::LimitVelocity() { 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. - if (length > 1500.0) + if (length > topspeed) { - // This should really be sv_maxvelocity * 0.75 or something - pev->velocity = pev->velocity.Normalize() * 1500; + // DONE: This should really be sv_maxvelocity * 0.75 or something + pev->velocity = pev->velocity.Normalize() * topspeed; } }