summaryrefslogtreecommitdiff
path: root/src/game/g_buildable.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2001-06-28 17:37:14 +0000
committerTim Angus <tim@ngus.net>2001-06-28 17:37:14 +0000
commit226e258294398f21bed09a5c1445da7ef42f851d (patch)
tree1ac486444965e43e635fb04641ac8e74e13c3782 /src/game/g_buildable.c
parent66a485adffa42e5e3d4912c63cd13c3a8f885a36 (diff)
Fixed client dependant stamina speed
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r--src/game/g_buildable.c12
1 files changed, 12 insertions, 0 deletions
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 ] );