From cfeb57df4859681f71d56cdb1c4f69d8e61db113 Mon Sep 17 00:00:00 2001 From: dystopm Date: Wed, 12 Jul 2023 22:56:43 -0400 Subject: [PATCH 1/3] Adjust gib's velocity limit according to sv_maxvelocity --- regamedll/dlls/gib.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/regamedll/dlls/gib.cpp b/regamedll/dlls/gib.cpp index 5b9122d04..45590fac6 100644 --- a/regamedll/dlls/gib.cpp +++ b/regamedll/dlls/gib.cpp @@ -6,12 +6,18 @@ void CGib::LimitVelocity() { float length = pev->velocity.Length(); - // ceiling at 1500. The gib velocity equation is not bounded properly. Rather than tune it +#ifdef REGAMEDLL_FIXES + float topspeed = Q_min(1500.0f, CVAR_GET_FLOAT("sv_maxvelocity")); +#else + float topspeed = 1500.0f; +#endif + + // 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; + pev->velocity = pev->velocity.Normalize() * topspeed; } } From 26e2819f9f6b3239908c4115c243ca0b96233cc2 Mon Sep 17 00:00:00 2001 From: dystopm Date: Fri, 14 Jul 2023 00:44:54 -0400 Subject: [PATCH 2/3] Gib max velocity adjusted to sv_maxvelocity --- regamedll/dlls/gib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/regamedll/dlls/gib.cpp b/regamedll/dlls/gib.cpp index 45590fac6..5580ccc2d 100644 --- a/regamedll/dlls/gib.cpp +++ b/regamedll/dlls/gib.cpp @@ -7,7 +7,7 @@ void CGib::LimitVelocity() float length = pev->velocity.Length(); #ifdef REGAMEDLL_FIXES - float topspeed = Q_min(1500.0f, CVAR_GET_FLOAT("sv_maxvelocity")); + float topspeed = CVAR_GET_FLOAT("sv_maxvelocity") * 0.75; #else float topspeed = 1500.0f; #endif @@ -16,7 +16,7 @@ void CGib::LimitVelocity() // in 3 separate places again, I'll just limit it here. 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() * topspeed; } } From 154b7bf0c85660c78d4f629c0738c9127f1470e0 Mon Sep 17 00:00:00 2001 From: Dmitry Novikov Date: Sat, 15 Jul 2023 04:34:32 +0700 Subject: [PATCH 3/3] Update gib.cpp Remove macro REGAMEDLL FIXES. --- regamedll/dlls/gib.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/regamedll/dlls/gib.cpp b/regamedll/dlls/gib.cpp index 5580ccc2d..069b118d9 100644 --- a/regamedll/dlls/gib.cpp +++ b/regamedll/dlls/gib.cpp @@ -5,12 +5,7 @@ LINK_ENTITY_TO_CLASS(gib, CGib, CCSGib) void CGib::LimitVelocity() { float length = pev->velocity.Length(); - -#ifdef REGAMEDLL_FIXES - float topspeed = CVAR_GET_FLOAT("sv_maxvelocity") * 0.75; -#else - float topspeed = 1500.0f; -#endif + float topspeed = CVAR_GET_FLOAT("sv_maxvelocity") * 0.75f; // 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.