From 226e258294398f21bed09a5c1445da7ef42f851d Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Thu, 28 Jun 2001 17:37:14 +0000 Subject: Fixed client dependant stamina speed --- src/game/g_buildable.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/game/g_buildable.c') diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 051c2209..6441a130 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -362,9 +362,21 @@ qboolean hdef1_trackenemy( gentity_t *self ) { vec3_t dirToTarget, angleToTarget, angularDiff; float temp; + float distanceToTarget; + float timeTilImpact; VectorSubtract( self->enemy->s.pos.trBase, self->s.pos.trBase, dirToTarget ); + +//lead targets +#if 1 + distanceToTarget = VectorLength( dirToTarget ); + timeTilImpact = distanceToTarget / 2000.0f; + VectorMA( self->enemy->s.pos.trBase, timeTilImpact, self->enemy->s.pos.trDelta, dirToTarget ); + VectorSubtract( dirToTarget, self->s.pos.trBase, dirToTarget ); +#endif + VectorNormalize( dirToTarget ); + vectoangles( dirToTarget, angleToTarget ); angularDiff[ PITCH ] = AngleSubtract( self->turloc[ PITCH ], angleToTarget[ PITCH ] ); -- cgit