Clamp gravity.

This commit is contained in:
Andrey Akhmichin 2021-04-04 07:32:25 +05:00
parent 17ab997501
commit 08f5c265ce
1 changed files with 4 additions and 1 deletions

View File

@ -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?