From 08f5c265cefebf665eda88d93770ee543a9c4c4f Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 4 Apr 2021 07:32:25 +0500 Subject: [PATCH] Clamp gravity. --- dlls/bigmomma.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/bigmomma.cpp b/dlls/bigmomma.cpp index a73334ff..584a6737 100644 --- a/dlls/bigmomma.cpp +++ b/dlls/bigmomma.cpp @@ -1034,7 +1034,7 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot Vector vecScale; Vector vecGrenadeVel; Vector vecTemp; - float flGravity = g_psv_gravity->value; + float flGravity = Q_max( g_psv_gravity->value, 0.1f ); // calculate the midpoint and apex of the 'triangle' vecMidPoint = vecSpot1 + ( vecSpot2 - vecSpot1 ) * 0.5f; @@ -1050,6 +1050,9 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot // Don't worry about actually hitting the target, this won't hurt us! + // TODO: Need another way to calculate height because current calculation is completely wrong + // and there posible crash. + // How high should the grenade travel (subtract 15 so the grenade doesn't hit the ceiling)? float height = vecApex.z - vecSpot1.z - 15.0f; // How fast does the grenade need to travel to reach that height given gravity?