summaryrefslogtreecommitdiff
path: root/src/game/g_weapon.c
diff options
context:
space:
mode:
authorRoman Tetelman <kevlarman@gmail.com>2009-10-03 11:51:48 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:27 +0000
commitb872e6e113c5372b9d698fc457fe620b195f5dfd (patch)
tree10abd3e8b0bb9f896d0893eb8fe3ed4107300cee /src/game/g_weapon.c
parent9b3c15abfc5881f1b949e5fe48bca29640c1f129 (diff)
* wide traces (most alien attacks) now prefer the target in the crosshairs if there is one
Diffstat (limited to 'src/game/g_weapon.c')
-rw-r--r--src/game/g_weapon.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index b68badb9..47ad4765 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -157,9 +157,12 @@ static void G_WideTrace( trace_t *tr, gentity_t *ent, float range,
VectorMA( muzzle, range, forward, end );
G_UnlaggedOn( muzzle, range );
+ //prefer the target in the crosshairs
+ trap_Trace( tr, muzzle, NULL, NULL, end, ent->s.number, CONTENTS_BODY );
// Trace against entities
- trap_Trace( tr, muzzle, mins, maxs, end, ent->s.number, CONTENTS_BODY );
+ if( tr->entityNum == ENTITYNUM_NONE )
+ trap_Trace( tr, muzzle, mins, maxs, end, ent->s.number, CONTENTS_BODY );
// If we started in a solid that means someone is within our muzzle box,
// the trace didn't give us the entity number though so do a trace